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
9 views

Angularjs:open on focus feature to my calendar

How can i add open on focus feature(similar as Microsoft windows 7 calendar) to my calendar as given in demo where we using angular materiel version1.0.1, please help me with solution. Thanks In ...
0
votes
1answer
28 views

How to append a custom directive and make it execute in the DOM on user click action

I am trying to implement something in which I want to add elements to DOM on button click. Previously I implemented it using jquery and it worked fine however I was unable to pass data from front-end ...
1
vote
0answers
14 views

Is it possible to reverse ng-infinite-scroll in Angular js?

I am new in AngularJs . I have implemented ng-infinite-scroll to show my posts as per it's documentation on this link.Now scrolling works top to bottom. But how can I implemented it in reverse order ...
1
vote
1answer
38 views

This simple directive is not showing

I'm trying to learn Angular. I have a plunker here: https://plnkr.co/edit/Qiu2SOjti2PVYhjRqO2O?p=preview I'm trying to display a directive called 'simple' on the home page. I'm not getting any ...
1
vote
0answers
16 views

how can Highslide work together with AngularJs

Here is my js code define (function (require) { ... const hs = require('highslide'); ... app.directive('anaResult',['$document', function($document) { return { link: function(...
1
vote
2answers
38 views

Issue with Isolated scopes in angular

I am trying to run this program and I see no output. Can you please let me know what I am missing here. Thanks in advance. <html> <head ng-app="myApp"> <title>Test</title> &...
0
votes
1answer
16 views

Angular UI Bootstrap 2.3 Modal is not rendering sightly parameters

I am having a compatibility issue with Angular UI Bootstrap Modal and sightly Parameters. When I try to render the sightly parameters inside the Modal the modal does not render the value in the ...
0
votes
0answers
9 views

Is it possible to decorate global function only inside a certain directive?

I have some problems with JAWS16 which read the actually source code inside aria-live instead of their value for bindable elements. Using the code below, JAWS would read "bracket bracket item dot ...
0
votes
2answers
23 views

Issue when referencing Angular directives

im trying to implement the AngularJs directives to my project but i'm getting stuck with this issue. I have the App.js, ControllerA (which includes a directive on it) and ControllerB. Note that both ...
0
votes
0answers
18 views

How to add/extend UI elements to angularjs material design component?

we have calendar to select date of birth in our web application, for that we used datepicker component of angular material 1.0.9 now we are planning to update our calendar with on focus date feature(...
0
votes
1answer
39 views

Delay generating directive until after page is ready and responsive

I'm working on a single-page app where some parts are really slow. They're slow because I'm displaying 400 complex things in a repeater for the user to scroll through. Each thing is generated by a ...
0
votes
0answers
17 views

Two way data-binding in directive doesn't work angular js (ionic)

I try to use two way data-binding in directive because i need the reference to the object for use the plugin swiper, but the data-binding works only on one way.From the directive to controller it not ...
1
vote
1answer
43 views

Angular 2 image src as function return

In my angular 2 application i have a comment system like the facebook's one, when users can comment on a post, i have to display the message, the user name and the user profile image. My problem is ...
0
votes
1answer
24 views

How to Wrap a JS Encapsulating Function Around a Directive

I have seen this done before, I am trying to implement an encapsulating function, but it breaks my directive. Without the encapsulation it works. Has anyone done this before or does anyone know why it ...
5
votes
1answer
47 views

Two way data binding is not working in directive

I'm fairly new to AngularJS and it's the first time I'm writing a directive. I'm trying to make Bootstrap Year Calendar work with AngularJS. It is a jQuery plug-in to show a calendar with ...
1
vote
1answer
20 views

Which function will execute first in angularjs directives? link or controller?

I have gone through this link https://www.undefinednull.com/2014/07/07/practical-guide-to-prelink-postlink-and-controller-methods-of-angular-directives/, they said the order(first to last) of ...
0
votes
0answers
18 views

How to download file through post/get ajax call in Angular JS

I've an angular app which makes ajax call to download file with some data. As data is huge, don't want to block the UI and hence doing it in Ajax call. But since it's an ajax call, browser doesn't get ...
2
votes
0answers
36 views

Which is preferable controller or link function in AngularJS directives?

Angular docs said: Best Practice: use controller when you want to expose an API to other directives. Otherwise use link. Why should we use link functions if we don't have any APIs to expose from ...
0
votes
2answers
26 views

Angular JS: Can we assign custom CSS to an HTML element more than once in a directive?

I created a custom directive whose purpose is to dynamically assign a base64 string and file extension as a background image to a <div> which will be used as a user profile photo. Here is the ...
0
votes
2answers
28 views

Angularjs 1 directive templateUrl failure

https://docs.angularjs.org/error/$compile/tpload?p0=dashboard%2Fhello.html&p1=404&p2=Not%20Found And I try rebuild the error in http://plnkr.co/edit/TUFDwgfw5BHRl3VwtUTr?p=preview Can ...
0
votes
1answer
16 views

Angular Directive - Scope Breaks after adding directive

I am going through this tutorial. https://code.tutsplus.com/tutorials/mastering-angularjs-directives--cms-22511 For some reason when I add my directive. myPerfectDirective It breaks the scoped ...
2
votes
0answers
28 views

Generic way to add directives from a directive

I'm trying to write an Angular 1 directive that will dynamically add other directives to the element. These other directives are complicated enough to where I don't want to copy and paste their code ...
0
votes
0answers
27 views

Tooltips on FullCalendar hanging about even after mouse pointer has moved away from the event

The Context We are using JQuery FullCalendar v2.3.1 [ ttp://fullcalendar.io/ ]. We have AngularJs Fullcalendar Wrapper for it [ http://arshaw.com/fullcalendar/ ]. this wrapper exposes the calendar as ...
0
votes
1answer
26 views

Specifying a Controller for a Directive to use on a specific page

My question is whether specifying a Controller for a Directive per page (or wherever needed) is "allowed", not such a good idea, or whether there is perhaps a better way of doing thing? Example: ...
0
votes
0answers
18 views

Can I transclude a template into ng-repeat

Is there any way for me to 'transclude' a template into ng-repeat and the template can share the scope with ng-repeat. I know transclude property will link the scope to then parent's scope, so is ...
0
votes
1answer
16 views

From run block can i able to call angular scope function inside another controller instead of $rootscope

I need to call angular Scope function inside some controller from runblock. can i able to call the function or else need to use rootScope or $scope.apply. First method: myAPP.run(function ($...
0
votes
1answer
11 views

Class name returned by compile, pre, post but not by Directive Controller

I am accessing the class name and printing them in console. This works fine for compile, pre, post but gets error for directive controller. Can someone resolve? //module declaration var app = ...
0
votes
0answers
12 views

What would be the best way to define all children and grandchildren elements inside a popup?

I'm writing code for a pop-up window which is suppose to close the pop-up when user clicks anywhere on the screen but the pop-up. Buttons Save and Cancel close it as well. The Pop-up is a form to ...
1
vote
2answers
25 views

Printing attribute in pre & post link in Angular Directive

I am trying to access and print class names in angular directives. But, I am not getting desired result. Instead, getting undefined for all values. //module declaration var app = angular....
0
votes
1answer
20 views

Disable/re-enable button within isolate scope directive in Angular

I need to enable/disable a button after click with Angular. When a user clicks "Submit form", it makes an http request. If an error occurs (inside the catch), I want to re-enable the directive button ...
1
vote
1answer
28 views

How to change the path from custom directive? Angular

I have the following directive which is a button and trying to change the path when clicking on the button but nothing happens. app.directive('searchAgainButton', function ($location) { return { ...
0
votes
1answer
25 views

Handle cell click event on Angular Gantt

I am trying to customize the behaviour of Angular Gantt. On cell click : I have to get the current cell value & corresponding header value. I gone thru the documentation present in this url : ...
0
votes
2answers
26 views

Why compile running multiple times - Angular Directive

In the following snippet, I want to ask that if compile phase runs only once for all the instances of a directive, then why am I seeing console.log("compile") run 5 times? It should have run only once?...
0
votes
0answers
21 views

Async validation with Angular JS $parsers.push

I am using Angular 1.5.8 and I would like to create a custom directive for email validation. I am using modelCtrl.$parsers.push to capture what the user is typing. I test the text with an email ...
-1
votes
1answer
33 views

How to call a multiple controllers in single template in angularjs?

angular.module('test') .controller('list', function($scope) { //i need to call entire test controller here// }); angular.module('test') .controller('getCustomers', function($scope) { }); How ...
0
votes
2answers
26 views

AngularJS directive for calendar

I'm migrating an existing site to AngularJS and I'm having trouble with Boostraps's datepicker. HTML: <div id="calendar" class="pull-right"></div> JS: $('#calendar').on('changeDate', ...
3
votes
2answers
47 views

How to assign 'ng-style' directive value based on 'ng-repeat' count

I have an Angularjs sample snippet. here using ng-repeat directive to display names in a table, I am planning to add ng-style directive to add vertical scroll bar to a table based on table row count. ...
0
votes
1answer
22 views

angular js dependency module config works one time

I have a module composition like this: angular.module('mainModule',["cityModule", "countryModule"]); angular.module('mapModule',[]); angular.module('cityModule',["mapModule"]); angular.module('...
0
votes
0answers
31 views

AngularJS directive input fields are read only

So I am trying to write an AngularJS (version 1.4.8) directive which outputs the value of an attribute in an input box. The directive looks like this: (function () { angular.module("myApp")....
-2
votes
0answers
17 views

Is the id attribute redundant when using 'name' with AngularJS2

I'm learning Angular 2 from this tutorial. It features the following code. I'm curious as to the use of 'id="XX" ' when we have 'name="XX"' used in the Angular directive. It doesn't seem to make a ...
0
votes
0answers
15 views

How to get directive's ng-model value from directive to view or controller?

JS file (some part): $scope.selectedData = null; $http.get("http://localhost:7643/api/MemberApi/GetMembers/") .success(function(data) { $scope.datas = data; $scope.onSelect = function(...
0
votes
0answers
44 views

Reading directive attribute value in controller

If I have a directive which is used twice like this in a specific view : <token-dialog token-target="compose.mailing.title"></token-dialog> . <token-dialog token-target="compose....
0
votes
1answer
20 views

Angularjs 1.5 replace directive element html

I want to built an ng-repeat with dynamic buttons that change according to $state.params so I wrapped them in a directive. link:function(scope,element,attrs) { $rootScope.$watch('params.source',...
0
votes
1answer
25 views

Rendering part of component outside of the component itself

I have JSFiddle like this: https://jsfiddle.net/ownvjjow/ Basically the problem is that I'd like to render some part of component x outside of the element(x) itself. Like in the outer scope, but ...
0
votes
0answers
16 views

Scroll to various location on an Angular page using href and $anchorScroll without reloading the page

I am trying to create menu links that will allow the user to scroll to various locations on a single page without reloading the page. I have been able to get this to work using some of the questions ...
0
votes
0answers
23 views

Angular: Implement 'Save Changes' on leaving state (Screen)

Can someone guide me is there anyway to prompt for confirmation like 'Do you want to save you data?' whenever user has added something in form (Say form is touched) and he is trying to leave that ...
0
votes
1answer
21 views

Add DOM element when transcluding except for the last one child

I would like to add a <hr> element between each clone of my transclude function except for the last one clone. The parent directive have a custom HTML template. In this template, I call a ...
2
votes
4answers
70 views

Directive with ng-model Attribute Not Resolving Using $http

Trying to make a rating directive but I'm stuck at getting rating2 to work. The first rating worked because the rating1 is hardcoded within the controller. But normally I have to get the saved rating ...
1
vote
0answers
35 views

Is it better to use directive with or without isolated scope for a custom input field validation directive? [closed]

I have a directive for checking form validation. Requirements are Check if ngModel value is empty. Call a function only if all values are filled. Also set a variable true or false based on the ...
0
votes
4answers
38 views

Why do we need directives in angularJS?

I am a newbie in angularJS so those who read this, may feel this as a silly question. But the answers for the question that google returns is not actually answering my question. The below link ...