Questions tagged [angularjs-directive]

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.

Directives are a way to teach HTML new tricks. During DOM compilation directives are matched against the HTML and executed. This allows directives to register behavior, or transform the DOM.

A directive is a behavior or DOM transformation which is triggered by the presence of a custom attribute, element name, or a class name. A directive allows you to extend the HTML vocabulary in a declarative fashion.

Angular comes with a built in set of directives which are useful for building web applications but can be extended such that HTML can be turned into a declarative domain specific language (DSL).

One can create his/her own custom directives in order to have own manipulations according to one's requirement.

Useful links

17531 questions
4
votes
2 answers

Dynamically select directive based on data

I am trying to populate a table based on an array of objects. This array doesn't contain objects of the same type and for each row I'd like a completetly diferent style and, onclick function, basically a completely different behaviour. For…
4
votes
0 answers

Changing ng-disabled in a custom directive

I'm trying to wrap a button with a directive that will disable it according to the response from an external service. However, I need to preserve the original ng-disabled value (if any) of the button. I manage to get this done by changing the…
ethanfar
  • 3,733
  • 24
  • 43
4
votes
0 answers

Zingchart with angular directive

I use zingchart with angular, It works perfect when I display a chart in a single page, but when I try to include the template with zingchart in a tab, It doesn't show and I don't have any error in a browser's console, HTML :
4
votes
1 answer

Angular2 (hybrid mode) can't Downgrade Directive to NG1 (ES5)

My problem Is that I'm trying to create an Angular2 attribute directive in ES5 while still in hybrid mode (using UpgradeAdapter). So all Angular2 code is being converted down to NG1.This is done by utilizing UpgradeAdapter's 'downgradeNG2Component'…
jgramling17
  • 41
  • 1
  • 2
4
votes
3 answers

Angular js : Unable to create directive

I am trying to create directive but my directive function is not getting called. index.html
print from direcetive
Praveen D
  • 2,337
  • 2
  • 31
  • 43
4
votes
5 answers

Angularjs typeahead example is always not working

I am trying to use a case on angularjs typeahead now, but it is always not working, am I forget to import some js files? please help me out, thank you Html:
4
votes
1 answer

How to prevent jwt token getting lost on page refresh in an angularjs application?

I am trying to authorize a user using jwt token. But if i refresh the page, the jwt gets lost and the token is not sent on subsequent requests to the server. I am using localstorage for storing the token and spring-mvc for backend. This is the…
darkknight
  • 216
  • 5
  • 15
4
votes
3 answers

can't use 2 js functions with sleep between them

I am trying to create an angular form where the user types text and while he does it the text lable below say "user is typing...". Then it waits for 200 mili seconds and the text lable goes blank (the "user is typing" disappear). I am doing it with…
Matoy
  • 1,738
  • 3
  • 22
  • 53
4
votes
2 answers

AngularJS formatted number calculation

Yesterday, I am having trouble on how to make a formatted number in my number fields but now that I achieve it, I am having problem on how to do the calculation. index.html
aldesabido
  • 1,268
  • 2
  • 17
  • 38
4
votes
2 answers

Angular 2 bootsrap app component without template/template is served with html

I used to build applicaitons with angular1, there was possible to have directives on the allready loaded DOM elements, it was like you have the main component (app), wich is build from loaded html and then inside you can load directives from ether…
mirazasx
  • 156
  • 1
  • 6
4
votes
2 answers

two way binding on primitive variables in angularjs directive

Trying to have 2 way binding on an AngularJS directive while using primitive objects is not working, for example: how can this be achieved?
Ben Yitzhaki
  • 1,376
  • 16
  • 31
4
votes
1 answer

ng-repeat in mddialog repeats itself multiple times

I have a problem using the ng-repeat in a angular materials dialog (mdDialog). The ng-repeat, repeats itself, depending on the length of the array, if it has 4 elements, then it runs for times. What I want is to print a list of checkboxes: This is…
4
votes
1 answer

Angular: Add attribute (programmatically) to element with binding

I have this attribute directive which under specific conditions needs to add an attribute. But thats not all, I also want to bind the value of this attribute to a property on the $scope. In code (simplified) this looks…
Jeanluca Scaljeri
  • 26,343
  • 56
  • 205
  • 333
4
votes
1 answer

Multiple forms on same page using same directive AND one form inside an element directive

BACKGROUND: I'm trying to create a "halt navigation if form is dirty" directive. I've looked at several questions/examples on SO and I've put together something that is somewhat functional, but not quite right. I'm trying to use this directive as an…
4
votes
1 answer

Vertical Slider of Angular Material does not work correctly

I use Angular Material for my application. It works fine if there is no content above it. But when I put some content and the scroll bar appear, it goes wrong when dragging. Working example: angular.module('MyApp',['ngMaterial', 'ngMessages',…
Than Ngo Hoai
  • 479
  • 3
  • 10
1 2 3
99
100