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.

learn more… | top users | synonyms

0
votes
0answers
16 views

Optimization for compilation process of Angular Directives

How to optimize compilation process of Angular Directives in case of a complex DOM structure where more than one directive need to be compiled for a single UI component. <chat-window> <...
3
votes
2answers
2k views

What is the difference between ng-class and ng-style?

ng-class and ng-style both seem to be methods of dynamically setting CSS classes. What is the difference between them?
2
votes
2answers
2k views

$scope.formName.fieldName.$setValidity is not working

I would like to set invalid with angular when firstname is equals to lastname and change the color using styles to red. http://jsbin.com/japir/2 function RegoController($scope) { $scope.app = {...
2
votes
3answers
12k views

Using angular, How do I get selected value on ng-change on a dropdown?

So I have some data coming in a string seperated by commas. sizes: "Small,Medium,Large,X Large,XX Large" I got a drop down that displays value based on splitting that string. <select ng-options=...
0
votes
2answers
24 views

Create angular directive like ngDisabled to check roles in list

I want to create an attribute directive like ngDisabled to enable or disable elements if some specific role is present on my service. angular.module(...) .service('RolesSerivce', function() { ...
0
votes
1answer
7 views

ES6 Angularjs directive, passed in function from calling controller has no constructor variables

I am using ES6 but I am not sure this is an ES6 issue I am trying to implement a 'login with google' button using the google api gApi and angular. I have wrapped the gApi call into a directive. ...
7
votes
2answers
16k views

How add options to a select with an AngularJS directive?

I have a select tag (to be used for country selection) which I want to prefill with options using a directive: <select class="countryselect" required ng-model="cust.country"></select> ...
0
votes
0answers
2 views

Integrate magento with angular

I am trying to find out the best solution for a new application. This application will be built on Magento CE 1.9.2. Due to the front end design which requires lot's of elements such as complex and ...
0
votes
1answer
13 views

Angular $http using json file works but using json file with $httpBackend is not working to display data

I can fake getting data from json file with using $http but with $resource/ $httpBackend I don't get any results $http.get (works) $http.get('api/devices.json') .then(function (result) { ...
59
votes
6answers
91k views

Using ng-click vs bind within link function of Angular Directive

In the link function, is there a more "Angular" way to bind a function to a click event? Right now, I'm doing... myApp.directive('clickme', function() { return function(scope, element, attrs) {...
1
vote
1answer
25 views

how to select element inside angular1.5 component

For component, I can no longer refer to Elem or Attr like I used to in its father -- directive, by taking them as arguments inside link or post. What is the best way to select element like I used to ...
0
votes
2answers
27 views

How to avoid using 'scope.$parent…' in angular 1.2

We're developing a set of (ideally) flexible, component-based re-usable templates in angularjs 1.2 to develop a series of e-learning modules. Part of the spec requires the tracking of 'completable' ...
19
votes
4answers
39k views

Angular, input field with a currency mask directive for money format on the fly

I'm trying to create an input mask for a EU money field using http://jquerypriceformat.com/ So far in my directive, the input shows correctly to the user with the mask applied, but I believe there's ...
1
vote
2answers
34 views

angular directive, http request and ng-repeat

I'm trying to make a custom directive that gets data from a http request, and then through the template, loop the received data with ng-repeat. I have made the http request working, but now I'm stuck....
0
votes
0answers
14 views

Instance dependent reusable components in AngularJS

Can someone point me in the right direction, please? I am having an issue with reusable components (controller/directives) not behaving as separate instances. Previously I coded all of the ...
0
votes
2answers
24 views

Passing ng-repeat local object to directive controller is not working

I'm trying to pass my ng-repeat local object to directive. I need to access the data from that object inside my directive controller. I'm confused about iso-lated scope and controller scope. Why it's ...
0
votes
1answer
7 views

Listen event on 1st child in AngularJS directive using jqlite

I'm working on a side navigation, which has tree structure only one level deep. Right now every thing is good, but instead of listening to events on the parent li I only want to listen on the 1st a ...
0
votes
0answers
16 views

Accessing a directive 'instance' on a different part of the page, in angular 1.2

In angular 1.2, I would like to have a 'bullet' component trigger a 'popup' to appear when clicked. The bullet component and the popup component are not within the same immediate controller. They ...
0
votes
1answer
22 views

Anguarjs Directive or Controller to seperate views components

I'm trying to learn Angularjs (1.5) I have already understood the concept of filters and services and I've also understood logic behind controllers and directives too. But when I started to write my ...
1
vote
1answer
33 views

Making a toast directive

I'm building an application in Angular 1.5 and I'm doing all the CSS etc myself. Until now, I've been handling errors and success messages by including the following code in all my html templates <...
0
votes
0answers
20 views

Set AngularJS Directive load order not defined on a single DOM

This is my first post here, usually I can find what I’m looking for before I ask but, if I missed the same question/answer elsewhere sorry. Anyway this is what I have. I’m working on an Angular ...
0
votes
2answers
35 views

How to enable text fields on other text field click?

I am using angularjs for my form , as form load i want to disable some field, after click on a text field disable fiels should be enable. i struggle a lot on it please help me to solve that. here is ...
1
vote
7answers
39 views

Angularjs $timeout not executing

I'm new to Angularjs and want to add a timer once the page load. I read a number of similar kind of questions here but still I couldn't resolve my issue. I added data-ng-init="init()" to my view. ...
1
vote
3answers
36 views

How do I use $timeout service in a Directive?

Basically, I want to measure the width of the element after angular has manipulated the DOM. So I would like to use $timeout for that, but it keeps getting me errors. HTML <div ng-app="github"&...
8
votes
1answer
3k views

Form Validation and fields added with $compile

I have a question regarding form validation. It is not working for me in the following scenario: I have a global form, inside the form dynamic fields are rendered using a directive. That directive ...
1
vote
1answer
22 views

How to display data coming from an object in the directive link function angularjs?

I am calling data from an object which is in the main controller. And it is displaying perfectly fine. I have a requirement now which I have to move the object in the directive's link function, and ...
2
votes
3answers
45 views

Use directive with different controllers in AngularJS?

I have created a directive for a search box which i want to use with different views. Here is the directive - angular.module('jobSeekerApp') .directive('searchBoxDirective', function () { ...
0
votes
0answers
18 views

Export html in pdf,doc,csv,xml and txt using angularjs

I have multiple html tables and div(html tag) in single page.I want to export this html tables and div using angularjs.and also remove some column(eg.in a table last column add delete,edit and details)...
2
votes
2answers
28 views

Angular app is not defined when adding a custom filter outside of function

Trying to follow some examples, but I get app is not defined app.js (function () { "use strict"; var app = angular.module("deviceManagement",['angularUtils.directives.dirPagination']); }()); ...
0
votes
0answers
8 views

Client only pagination for tree-grid-directive

I am using following ‘tree-grid-directive’. https://github.com/khan4019/tree-grid-directive Is there any way to do client only pagination, if not than is it possible to do client/server pagination?
0
votes
2answers
510 views

generator-angular-fullstack directive templateurl not rendering

Disclosue: This has been thoroughly checked for duplicates and on-topic/off-topic. This is an issue that my roommate also has when he tried it so it is obviously a common issue. I have found others ...
2
votes
1answer
33 views

Changing HTML of an element dynamically through a directive

I'm trying to change the HTML of an element based on a variable that is passed as an attribute of a directive. The content is supposed to be changing back to the 'This is the original content...'. ...
19
votes
2answers
16k views

Use Angular Directive attributes in it's template

How can I use the value of an attribute in a Directive? My element looks like this: <div class="tooltip-icon" data-my-tooltip="click" data-tooltip-title="foo" data-tooltip-content="test content"&...
8
votes
1answer
8k views

Access parent element(body) in directive link function

Given a HTML structure similar to this: <body> <div id="one" my-directive></div> <div> <div id="two" my-directive></div> </div> </body&...
2
votes
1answer
19 views

how to resolve file in angular directive?

With angular stats we can load file like this: .state('app.dashboard.v1', { url: '/v1', templateUrl: 'views/index.html', data: { pageTitle: 'Dashboard v1' }, ...
0
votes
3answers
20 views

Get the child input tag for the current checkbox clicked

I am trying to get the child input tag for the current checkbox that is clicked and add checked to it through my directive. I have the directive setup correctly but I am getting undefined when I try ...
1
vote
1answer
22 views

Angular JS UI-Router not working

It doesn't display anything on view nor any error on console log. Have checked with case sensitives too still couldn't solve the problem. Saw other posts too still couldn't find where am making ...
0
votes
1answer
32 views

ngHandsontable: date-format not working in hot-column directive

I try to format a date column as follows, both with the settings as well as the direct date-format attribute. Neither works. The column type is set to date and the provided data is of type date. &...
-1
votes
3answers
30 views

Change Page Title Dynamically AngularJS

Below is my code, i need to change the maintitle dynamically in h2 tag on click of navigation (navlinks) through angularJS. Thanks in advance.. var portfolioApp = angular.module('portfolioApp', [...
0
votes
0answers
34 views

ng-repeat and custom directive transclude trouble

I wrote my own directive, here some code: app.directive 'rateHighlight', ($timeout) -> { restrict: 'E' template: require './view.html' scope: { value: '=value' }, transclude: true, controller: [ ...
-1
votes
0answers
19 views

ionic framework auto complete search result with label in diffrent levels using $http in android platform

I need auto complete search with label and levels (Like this http://seelocal.in/ . Please type in 'search here' box). I have spend two days to achieve this, but i'm failed. Please help me on this. ...
2
votes
1answer
37 views

ng-type directive on input element in angularjs

We can use data-binding on input elements like this: <input type="{{ showPassword ? 'text' : 'password' }}" name="password"> But this has similar problems as using data-binding on a href ...
3
votes
2answers
56 views

Using different controllers with custom directive in AngularJS?

I have created a search box which is being used on two different views, one is for searching jobs and the other is for searching companies. I have made two separate controllers for both and separate ...
0
votes
1answer
27 views

Angular: Variable template inside directive

In my Angular template I use an attributive directive as follows: HTML: <div id="my-template-one" my-template-directive></div> JS: // ... .directive('myTemplateDirective', ['myconfig',...
1
vote
1answer
3k views

Injecting data objects into a directive factory in AngularJS

So I have a directive that takes in data objects as an argument into the scope. The problem is that I handle all my data in my service layer. So this is some normal non-directive code: angular....
0
votes
0answers
19 views

Issue with Calender Control dates

Expectation In the below code snippet when I selecting Departure date in the calendar popup then automatically the cursor should go to, Arrival date and should display calender popup to select ...
0
votes
1answer
36 views

Creating angular Directive with custom attributes and template

i'm having some problems with a custom directive to display some images instead of a dropdown. but by now i'm stuck with displaying the correct html from my template function. Writing the image path ...
0
votes
4answers
21k views

why angularjs ng-repeat not working

I am trying out the basics of AngularJS first time. I am trying out ng-repeat first time. However it is not working. Here is a non working jsfiddle. I have written the code in single standalone ...
27
votes
8answers
48k views

How to manipulate styles of directive in AngularJS?

I'm writing a component using AngularJS and AngularJS directives. I'm doing something like this: var MyApp = angular.module('MyApp', []); MyApp.directive('myTag', function() { return { /* Some ...
2
votes
1answer
443 views

Call function after angular all directives are loaded

I have multiple custom directives in my ngApp. The demo code is: <top-nav></top-nav> <left-sidebar></left-sidebar> <div class="content"> .... </div> The ...