Tagged Questions
In AngularJS directives are a way to teach HTML new tricks by extending the HTML vocabulary. Directives allow you to manage DOM elements in a declarative pattern, freeing you from low level DOM manipulation tasks.
1
vote
1answer
12 views
Correct approach to code an AngularJS directive to generate a table from an array
I want to create a directive that generate a full table from an array, offers specific onMouseOver behaviour, and when a cell is clicked, emphasizes all cells with same value (and other specific ...
0
votes
1answer
17 views
Angular $watch newValue is undefined after the first click on a radio button
I have a radio button inside a directive and I have a number of these directive on the page. All of these radio buttons have the same name. When I click on any of them a newValue in a $watch is ...
1
vote
1answer
29 views
Auto increment value in custom directive
I have an issue respective to auto increment number in my custom directive template. The functionality I need is to add dynamic HTML content on the button click.
Main.html
<div class="...
0
votes
2answers
59 views
Angular2 version RC.6 “directives” inside @Componnet Error
I am using Angular2 and have downloaded package.json from official website. When I am trying to use "directives" inside @Component decorator I am getting error.
I have attached my code ERROR:
[ts]
...
0
votes
1answer
15 views
Module not found: Error: Cannot resolve 'file' or 'directory' when require a css file inside a directive
From an angular+webpack tutorial, a "directives" folder was created which contains a declaration for the following custom directive
export default ngModule => {
ngModule.directive('kcdHello', (...
0
votes
1answer
24 views
How to disappear Bootstrap popover using AngulatJS?
I am using bootstrap popover by this fiddle link http://jsfiddle.net/ivankovachev/U4GLT/
It's working when I click the text the popover is coming. in second click it's disappearing(toggling). it's ...
-2
votes
1answer
17 views
Components are replacements of directives? or component is a special type of directive?
Components are looks like same as directive without DOM manipulation. Without DOM manipulation means then why we go to use Components?
So My Question is : (Components are replacements of directives? ...
0
votes
0answers
29 views
Angular js unable to access updated scope in directive?
I created two directives and applied on element. when I alert ng-model in selectControlDir it get value in alert and from cbqControlDir I get undefined in alert.
I made some ajax call on load and on ...
0
votes
1answer
26 views
Angular directives disappear after POST
I've made a POST request to get html of block. Here is my post:
$scope.changeMenu = function () {
$http({method: "POST", url: "/menu"}).then(function (response) {
$scope....
0
votes
1answer
19 views
Angular directive doesn't work on table
I have the following table:
<table>
<thead>
<tr>
<th>Uno</th>
<th>Dos</th>
</tr>
</thead>
<!--directive template ...
0
votes
0answers
21 views
ng-click not firing with uib-datepicker-popup
I created a directive for date picker. Following is the html code.
<div class="input-group" style="float:left">
<input type="text"
class="form-control" placeholder="mm/dd/yyyy"...
0
votes
1answer
29 views
AngularJS - parse scope data as Angular expression
I need to create a directive which allows data passed in to contain angular expressions, such as the contrived example below (Codepen):
<div ng-controller="ctrl">
<list-test data="data"&...
0
votes
2answers
27 views
How to conditionally include script element in Angular
I'm trying to conditionally include a chat on my page:
<body ng-app="myApp">
<!-- some code -->
<script type="text/javascript" ng-if="expression">
window.$zopim||(function(...
0
votes
0answers
16 views
How can I update Second Dropdown data based on first dropdown selected item in Kendo Angular js
<select kendo-drop-down-list k-ng-model="testProperty().AssetPropertyType" k-options="GetAssetPropertyType" k-data-value-primitive="true" k-data-value-field="'id'" k-data-text-field="'name'" k-on-...
0
votes
0answers
24 views
Update scope in directive and make available for next directive in angular js
plunker for code
There are two directive link with a element.
HTML
<div class="row">
<div class="form-group">
<label class="col-sm-5 ...
0
votes
1answer
46 views
Are angularJS directive names unique (or not)?
Found this amazing video that explains angularJS directives. However, there is one thing that i heard that i have a question about.
"In angular directive names are not unique so we need to support ...
0
votes
1answer
13 views
Ionic , AngularJs: Directive attribute $watch stops working after view is rendered
I want to create an attribute directive for ionItem and I want it to watch its own value:
<ion-item ng-repeat="item in items" my-dir="{{data.watchedValue}}">….</ion-item>
I have an ...
0
votes
0answers
13 views
How can I filter by an array that is created in my directive?
When a user clicks on locations, it adds it to an array created in this directive:
(function(){
'use strict';
angular.module('careers')
.directive('locationSelection', function(){
...
0
votes
0answers
5 views
Ionic on-drag-over directive
I am trying to call a function when an element is dragged over. That is, when your finger slides to touch it, like a piano roll hitting each key. on-drag only calls for the item you touch down on as ...
2
votes
1answer
25 views
Angular material slider how to set ticks values
is there a way using angular slider to define sliding values for example if we have the min val 0 and max val 15 is it possible to set up the values that user can slide to from a list [3,4,6,9...] ...
1
vote
0answers
16 views
How to prevent destroy data from DataTable with Angular
I'm try to implement DataTables with Angular, I'm googled and some many solutions is creating directives, its ok but is very old only "normal" way draw a DataTable, the problem is sorting or typing ...
0
votes
1answer
19 views
does a directive need to list the service?
I know there are a few ways to format this but, if a new service is injected into the controller:
AnalyticsController.$inject = ['$scope', 'analyticsService', 'nvd3', 'gridster'];
Does the service ...
0
votes
0answers
37 views
When loading dynamic component using Angular 2 RC6, component life cycle events are not invoked
When loading a component dynamically using the following method, the constructor for said component is invoked but none of the life cycle events are (eg. ngAfterViewInit or ngOnInit).
let component = ...
0
votes
1answer
35 views
Angular 2 multiple errors such as Template parse errors and Can't bind to
I am new to AG2.Just started for 1 day. I tried some online tutorial and follow their coding exactly but get error.
directives: [favour_component] // only this line of coding is marked RED
Then ...
0
votes
2answers
29 views
How to define common directives in controllerAs syntax?
I was reading Digging into Angular's "Controller as" syntax article. It shows below snippet to use "Controller as" syntax in directive.
app.directive('myDirective', function () {
return {
...
0
votes
1answer
24 views
value in directive not changing even after its input changes
my main controller code is as follows
var self = this;
self.info = {};
Restangular.all('detail').post(this.postbody).then(function(data){
// this.items = data.tiles;
self.items = ...
0
votes
1answer
15 views
useInteractiveGuideline not working correctly in Angular nvd3
I'm trying to use angular nvd3 to draw a line chart with Focus, but I'm facing a problem using the interactiveGuideline useInteractiveGuideline : true,, in fact it uses only the first and last point ...
0
votes
1answer
23 views
AngularJS : When to use require 'ngmodel' and require options ( ? , ^ ,?^) in directives
When should I use require: 'ngModel' and require options in directive.
I would be happy if someone could explain this in simple language. What is the benefit of each
Require options.
2
votes
1answer
22 views
How to conditionally hide elements of an Angular Directive
I have an Angular Directive.
Here is the replica of it's template
<div>
<div>
<div></div>
<div></div> <!-- to be hidden in some places --&...
0
votes
0answers
13 views
angularjs ui tree is not functioning while using angularjs 1.5 controller as syntax
I am using Angularjs ui-tree, it is working fine if I use $scope models ($scope.list = [...]) in my controller. But when I am using var vm = this, angularjs 1.5 controller as syntax, then the tree is ...
0
votes
1answer
20 views
How can I transclude variable number of repeating elements?
I'd like to create a directive like "grid" that functions like this:
<grid columns="1">
<grid-item>One of unlimited number...</grid-item>
<grid-item>Another one...</...
0
votes
1answer
32 views
Pass object to a new page
I have some json which is being ng-repeated:
{
"title": "image title",
"description": "Lorem ipsum dolor sit amet, per ea ferri platonem voluptaria, ea eum ubique ornatus interpretaris. Dolore ...
1
vote
2answers
15 views
It's possible to change the templateURL through attributes in a angularjs directive?
I have the following directive:
(function() {
'use strict';
function header() {
return {
templateUrl: '/app/home/homeheader.html'
};
}
angular.module('app').directive('...
1
vote
0answers
18 views
angularjs - improve performance via caching/reusing compiled linked template
So i am using this library https://github.com/iVantage/angular-ivh-treeview, for displaying a tree and i am using a modal, issue for me is that everytime i open the modal it reloads the entire tree(...
1
vote
0answers
12 views
angular ivh tree view how to Defer DOM Tree Binding or delay transclusion
I am using the ivh tree library for displaying hierarchichal data.
https://github.com/iVantage/angular-ivh-treeview
I have a tree structure of approx ~2,000 nodes. and i get that data all at once. I ...
0
votes
0answers
25 views
Changing ng-click to ng-mouseenter doesn't call expression
I am working with this Ionic directive on GitHub.
I want it to work so that the user can drag on the scroll bar, so to begin with I am trying to get the letters to work on ng-mouseenter instead of ng-...
0
votes
1answer
21 views
Why isolated scope “&” is not working with controllerAs in directive of angularJs
index.html
<div ng-app="phoneApp">
<div ng-controller="ctrl as AppCtrl">
<div phone dial="ctrl.callHome('called home!')"></div>
</div>
</div>
app.js :
...
1
vote
2answers
30 views
angular material close mdDialog from template directive
I'm tring to close dialog by this manner :
showAlert(ev) {
this.mdDialog.show({
restrict: 'E',
template:'<loader></loader>' +
' <md-button ng-click="this....
0
votes
0answers
22 views
Telling angular to pickup a dynamically added directive
I am creating a bootstrap popover and I'm trying to use a directive in the content of the popover.
I use the following HTML:
<div data-animation="false"
data-template='<div style="width: ...
0
votes
1answer
13 views
Nested directives with transclusion
I have a set of form directives in which duplicate code can be extracted into a separate directive.
I know that I can use transclusion, but have not been able to identify any technique that allows ...
0
votes
2answers
36 views
How to check the disabled button is true/false ? in angularjs
Hi guys is there any ways on how to check the disable button ??
Here is my button disabled code inside (index.html):
ng-disabled="epUpdateAllForm.$invalid || epUpdateAllForm.$pending"
In ...
2
votes
2answers
59 views
Placing custom directive in Angular 1.5.8 using ng-repeat is not working
I am placing my custom-directive on the fly in my HTML using ng-repat directive.
But the custom-directives are not evaluated and if the placed the same directive on HTML directly then it is working.
...
1
vote
1answer
54 views
+50
angular Drag and Drop not working on mobile
I am using this lvlDragDrop plugin. It is not working on mobile platform.
On github they have added this issue. But still I dont have any luck.
Github Demo
HTML
<div ng-controller="ddController" ...
-1
votes
0answers
19 views
How to Manipulation in PDF using AngularJS? How to add hyperlink in pdf?
I am developing e-paper solution for newssite.
I am able to render pdf file in firefox browser. But i want to use its content have hyperlink functionality, so that it (content) will open in the new ...
-2
votes
0answers
6 views
element.lineClamp in directive's timeout function gived me “this.targetElement.lineClamp is not a function”
I'm using Jasmine Karma for unit testing Angularjs directives.
I'm trying to test a directive that lineClamps text. The problem is when element.lineClamp(2) is being called from the directive when ...
1
vote
2answers
36 views
Applying validation in angularjs directives
I'm building a set of reusable components in AngularJS 1.5.x version. Each directive accepts a model like below.
<app-grid ng-model="scope.gridModel" />
The gridModel is a simple class looks ...
0
votes
2answers
25 views
AngularJS - Unable to get Resolved Value of a Factory's Method which Uses Promises in Directive's TemplateUrl
I'm working on a very modularized project and currently I'm building an Element Directive which changes templateUrl based on user login/logout.
To do that, I'm trying to execute a Factory's Function ...
0
votes
1answer
33 views
Change ng-model in directive
I want to create UI using custom directive.
I am doing it as :
Directive :
module.directive('testData', function() {
return {
templateUrl: 'template/mainTemplate.html'
};
});
Template :
<...
3
votes
1answer
206 views
Angular 2 RC 6 Material 2 Alpha 8 Not Working
I recently upgraded my project to Angular 2 RC 6 and Material 2.0.0-alpha.8-1 but its not working, can anyone please guide what am I missing here? Can anyone please share a working plunker with ...
0
votes
0answers
11 views
Angular: Where would this constructor be placed?
I found a very useful tutorial on creating an angular factory that takes parameters. However useful, there's a hiccup.
Below, the factory creates an instance of a function-object/constructor. The ...