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
0
votes
1 answer
C macro or GCC directive to consume next code statement
Is there a C macro, a GCC directive or pragma, to consume the next code statement following the macro, without explicitly passing it as an argument to the macro?
Something like this:
#define CONSUME_NEXT_IF(a) if (a) { () } else;
And I…

MEE
- 2,114
- 17
- 21
0
votes
0 answers
arm-gcc: Multiple attribute sections in a .c file
I am facing an issue in creating multiple sections in a .c file. I wants to place code for task1 in section .task1 and code for task2 in section .task2
Consider the following code:
case 1:
#include
/* Variables for task 1 */
int…

user21096
- 11
- 5
0
votes
2 answers
Ng-repeat and directive expand one list item at a time
I have an ng-repeat code with expandable list items. I would like to expand one item at a time.
The way I am trying to do it is
in the html file

Kratos
- 1,064
- 4
- 20
- 39
0
votes
1 answer
Pass data from controller to directive angularjs
I am trying to pass data from controller to directive for dynamically updating rows in a table. but the table is not getting updated and no error is being shown in console.
This is my html:
$

darkknight
- 216
- 5
- 15
0
votes
1 answer
AngularJS ng-click not firing
I have a custom AngularJS directive for a textdown control. In it is an ng-repeat that is printing a list of div's for the emulated dropdown, and each item has an ng-click function. That function will not fire when the div is clicked. Can you…

JibbaJamba
- 3
- 2
0
votes
1 answer
Angular 2 get user input in directive
I try to create a numbers / numeric input only directive, which means I want to allow a input such as: 451,45 or 451.45
Currently the directive looks like this:
import {Directive, ElementRef, HostListener, Input} from…

jona jürgen
- 1,789
- 4
- 22
- 31
0
votes
1 answer
Angular modal directive - issue when having more than 1 in a page
I made a modal directive for my angular app.
modal-directive.js
'use strict';
backyApp.directive('appModal', function() {
return {
restrict: 'A',
transclude: true,
link: function($scope, elem, attr){
…

user3800799
- 534
- 1
- 5
- 18
0
votes
0 answers
Angular directive for form elements
I want to create directive which will be used for form elements like input,textarea,select...
My code:
app.directive('input', function() {
return {
restrict: 'E',
priority: -1000,
require: '^?required',
link:…

general666
- 1,001
- 2
- 16
- 31
0
votes
1 answer
AngularJS: how do I capture $event object in a custom directive?
I have a function that requires the $event obj to be passed into as a parameter. The function works just fine when I call it using ng-click. However, now I am told to change the function into a custom directive. But now I don't know how to access…

d1du
- 296
- 1
- 3
- 12
0
votes
1 answer
AngularJS: how do I create custom directive that takes in a parameter?
I want to create a custom directive that is an attribute that requires an attribute value similar to how ng-repeat takes a list of items. For example,
How is this done?

d1du
- 296
- 1
- 3
- 12
0
votes
3 answers
AngularJS calling a controller in a directive
I am trying to follow from what I can tell so far is a pretty decent tutorial but I am a little stuck on a part where I need to create a directive to seperate a chunk of html and use a controller to generate the data.
var app =…

HemlockDevelopment
- 33
- 1
- 3
0
votes
1 answer
angular directive - transclude with templateUrl
can transclude and templateUrl work together in a directive?
I'm trying to make a dynamic modal directive that supports html.
modal.js
'use strict';
myApp.directive('siteModal', function($http) {
return {
restrict: 'A',
…

user3800799
- 534
- 1
- 5
- 18
0
votes
1 answer
Angularjs v1 : Is it possible to create a data-custom-directive atrribute?
All is in the question :
I understood I have to declare the string with two custom letters than the uppercase word giving sense to the directive for example
djLoad
in the directive declaration which becomes
dj-load
in the view.
How about…

Mantisse
- 309
- 4
- 15
0
votes
2 answers
Angular directive that checks for number of children li elements
So I have a simple ul that ng-repeats li elements from the external source gathered with a promise. I also have a search input that filters these elements, and I would like for the ul to hide when it contains no more elements that satisfy the…

CountGradsky
- 268
- 2
- 4
- 15
0
votes
0 answers
Pass variable to AngularJS directive without isolated scope and updating it
I want passing variables to AngularJS directive without using isolated scope.
I need this variables are updated, and not static.
I read this example, the last answer:
Directive scope attributes without an isolated scope in AngularJS
But it works…

Laurianti
- 903
- 1
- 5
- 19