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
Php [an error occurred while processing this directive]
I am having problem with my php code. Directory and its code is working fine when direct accessing
For example subdomain.domain.com/folder_name_c/index.php?id=1
but when I use header() function to redirect to that directory it generates error. [an…

Auj
- 109
- 2
- 9
0
votes
1 answer
Angularjs: When does ng-repeat create new elements?
I understand that ng-repeat is a 'directive', and usually directives have two phases: 'pre' (drilling down into dom) and 'post' (coming back up).
In which of these phases does ng-repeat create the new elements (clones)?

dsdsdsdsd
- 2,880
- 6
- 41
- 56
0
votes
2 answers
Add a directive inside a different directive that has link fn
I have a directive that wraps a pure-JS library.
I want to add another directive I have and combine the two.
Currently I have:
Directive
app.directive('voPiechart', ['$window', '$compile',
function ($window, $compile) {
return {
…

AlexD
- 4,062
- 5
- 38
- 65
0
votes
0 answers
How to give id dynamically to an element in a js template
I want to give id dynamically to the button element of this HTML template which I'm creating in JS file. How can I do that. Help needed.
var template = '
'…

srv
- 61
- 1
- 1
- 11
0
votes
1 answer
Ng-show in a directive template
I'm trying to make a simple app with Angularjs and MongoDB. I have some articles where it's possible to add a comment and display them.
The comments section is in a template defined on a Directive, who is himself in the Home template with another…

Nitneq
- 651
- 10
- 26
0
votes
1 answer
angularjs custom form and field directive: ngModelController is not found in FormController
I have 2 directives, one is my-form, one is my-field.
I need to use the mode of dynamically creating the html content for both of these two directives.
Everything works well except I can not get the ngModelController of the input fields.
So I can…

Lune
- 241
- 1
- 3
- 13
0
votes
2 answers
can't access ng-model from directive template
I am trying to access a model which resides in template of directive. But directive's scope never displays that model. What wrong I'm doing ?
http://jsbin.com/xorujuqube/edit?html,js,console,output
[JSBIN-Reference]

Ronny
- 3
- 1
0
votes
4 answers
Angular directive templateUrl not working
This is my code so far, to return a view in browser via Angular custom directive, using @html.partialview
var newOne = function () {
return {
restrict: "A",
templateUrl: "newone.html",
replace: true,
scope: {},
…

Georgios
- 1,454
- 6
- 17
- 34
0
votes
1 answer
Angular Directive to mark a field as dirty when tabbed through
I've been working on an angular app where I need to be able to tab through fields
- if they are required, fail their validation
- If they are not, mark them as dirty
this way tabbing through the fields will show required fields as in error, but…

Nathanael Anderson
- 31
- 1
- 6
0
votes
1 answer
AngularJS passing a scope variable within a string to a directive
I'm fairly new to AngularJS Directives and was wondering how I could implement passing a custom string, which is a url that contains a controller variable, to be used later on by that controller?
Calling Directive
…

Scot
- 165
- 2
- 14
0
votes
3 answers
How to pass a value into a directives controller in angular?
My directive has a controller and I am trying to figure out how to pass a value from the directive that was passed in. In the example below 'name' is not valid posted to the console but it shows in the html when rendered. Obviously my example is…

silvster27
- 1,916
- 6
- 30
- 44
0
votes
2 answers
AngularJS : How to access generated data from a directive?
I have been working with AngularJS for months. Today, I need to create a directive that will help me add a fix header to a table. All the directives I've found were not good enough because of the way they deal with the columns size (I'm still opened…

Thib
- 25
- 5
0
votes
2 answers
angularjs: ngModelController is not found in FormController
I have 2 directives, one is my-form, one is my-field. Everything works well except I can not get the ngModelController of the input fields.
So I can not get the $dirty, $valid properties of these fields.
For example, when submitting, I want to get…

Lune
- 241
- 1
- 3
- 13
0
votes
2 answers
Use variable as expression in ng-include
This code works:
This code doesn't:
(ctrl.URL is set to "Test.html"). I also set it to 'Test.html' and "'Test.html'" with the same results.
How can I successfully…

Lairinus
- 110
- 10
0
votes
1 answer
AngularJS: Linking multiple scope variables inside external template
I am trying to build some custom directives for inputs with validations provided by ngMessages directive. Still, I can't link multiple variables from $scope to dynamically determine the form name and the input name. Here's my code so far:
The…

Lucian Vilcea
- 5
- 2