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]
1990 questions
48
votes
3 answers
How to use Angular structural directive with multiple inputs
I want to implement something similar with angular-permisssion. And with requirement to control the element's existance, I need to use angular structural directive.
At the beginning, i think such syntax would work:
e-cloud
- 3,891
- 1
- 19
- 37
![](../../users/profiles/3326749.webp)
e-cloud
- 3,891
- 1
- 19
- 37
46
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.:
![](../../users/profiles/2705308.webp)
jayflo
- 1,055
- 1
- 12
- 21
45
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…
![](../../users/profiles/1719105.webp)
Milko Lorinkov
- 553
- 1
- 5
- 7
41
votes
3 answers
AngularJS - Attribute directive input value change
I've got an AngularJS attribute directive, and I would like to take an action any time its parent input's value changes. Right now I'm doing it with jQuery:
angular.module("myDirective", [])
.directive("myDirective", function()
{
return {
…
![](../../users/profiles/164506.webp)
Mike Pateras
- 14,127
- 29
- 93
- 131
40
votes
13 answers
Check if variable exist in laravel's blade directive
I'm trying to create blade directive which echo variable (if variable defined) or echo "no data" if variable undefined.
This is my code in AppServiceProvider.php:
![](../../users/profiles/580621.webp)
pupadupa
- 1,278
- 2
- 15
- 29
40
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