A concept of 'command' used by many programming languages and frameworks. Use this tag with a language and/or framework to indicate context. The C/C++ pre-processor is one language that relies heavily on directives. They call it "pragmas".
Questions tagged [directive]
2065 questions
55
votes
2 answers
Passing array via attribute to AngularJS directive
I'm currently having a problem when passing an array to a directive via an attribute of that directive. I can read it as a String but i need it as an array so this is what i came up with but it doesn't work. Help anyone? thks in…

HeberLZ
- 12,715
- 4
- 22
- 24
51
votes
3 answers
AngularJS $watch window resize inside directive
I have revealing module pattern which looks like this:
'use strict';
angular.module('app', [])
.directive('myDirective', ['SomeDep', function (SomeDep) {
var linker = function (scope, element, attr) {
// some work
};
…

Lightfooted
- 799
- 1
- 6
- 13
47
votes
9 answers
Define AngularJS directive using TypeScript and $inject mechanism
Recently I started refactoring one of the Angular projects I am working on with TypeScript. Using TypeScript classes to define controllers is very convenient and works well with minified JavaScript files thanks to static $inject Array…

Milko Lorinkov
- 600
- 1
- 5
- 8
47
votes
4 answers
Angular JS resizable div directive
My site will have multiple sections, each of which I intend to be resizable. To accomplish this I've made a "resizable" directive, e.g.:

jayflo
- 1,105
- 1
- 12
- 21
45
votes
4 answers
What are practical scenarios of *ngTemplateOutlet directive?
I was reading about *ngTemplateOutlet directive. The use of this directive is to instantiate a template dynamically by a template reference and context object as parameters.
What I want to know is that we have so many things in Angular to achieve…

patrick.1729
- 4,222
- 2
- 20
- 29
42
votes
4 answers
what is the meaning of align an the start of a section?
What is the meaning of align an the start of a section?
For example:
align 4
a: dw 0
How does it save memory access?

user1462787
- 659
- 2
- 12
- 20
41
votes
2 answers
How to check if a method argument of a directive is specified in AngularJS?
I've created a custom directive which contains a button. This button calls a method from parent scope specified by 'callback' attribute.
Simple directive