Questions tagged [directive]

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".

2065 questions
0
votes
0 answers

AngularJS directive is not updating template if controller name is not attached

If I specify the controller property in the code below then my code will work. Otherwise the code is not updating the HTML template: function ngVisualizer($http, $timeout, SharedFactory, ThreejsFactory) { return { restrict: 'A', …
kmrrakesh
  • 137
  • 1
  • 1
  • 7
0
votes
3 answers

Can I use ng-app as an element?

Angular ToDo {{6+4}} Is this a valid angular syntax? Can I use ng-app as an…
0
votes
2 answers

What's the best way to extend angularjs directive functionality?

I've a directive to create a list of elements to control pagination and filters, I use it in several points of my application. I want to know what is the best way to add custom methods to the…
Sergio
  • 106
  • 1
  • 7
0
votes
1 answer

How do I create a directive in Angular that always places itself on the body?

I'm facing an issue with my modal dialog component (in Angular 1.5). It's placed within a scrolling area, which means on iOS it gets cut off wherever it overflows the containers (Sidenote, this seems to be a major bug that no one is talking about!…
tcmoore
  • 1,129
  • 1
  • 12
  • 29
0
votes
1 answer

AngularJS Wrapper Html

I am using same divs in my view but inside of divs are changing.So I want to make it in a directive. What is the way for this? Example;
Egomen
  • 93
  • 3
  • 11
0
votes
1 answer

Custom directive from jQuery not loaded correctly

I am trying to load -outside angular - dynamically a custom directive but the custom directive is not loaded in spite I have used $compile as the following : the custom directive is : app.directive('mydirective',function (){ return { …
JPNN
  • 383
  • 1
  • 7
  • 23
0
votes
1 answer

AngularJS ng-click not working inside directive dynamic template function

I created an Angularjs directory for an inline editor. The HTML template is created by using function and compiling with the HTML root element. My problem is I want to change a status variable when I click on an element to achieve toggling, but it…
0
votes
1 answer

Angularjs Controller Directive

How can i call a function from Directive? when the GetAllActivityActionDetails method gets called, function is not firing. contrller function : function GetAllActivityActionDetails() { alert("GetAllActivityActionDetails"); } Directive is…
SoloThink
  • 41
  • 9
0
votes
1 answer

How to pass a method to a directive and invoke it to pass data to a nested directive?

I wrote a directive, list, that displays a list of items. Then I wanted to reuse this component in another directive, wrapped-list that would modify the list (add some items, change some values), and add some cosmetic stuff around it. The list…
remio
  • 1,242
  • 2
  • 15
  • 36
0
votes
1 answer

Why isn't the scope variable defined in the directive showing in the view or controller?

I'm fetching data using a directive and creating a scope variable 'services', but it doesn't show up in the view and in the controller it is 'undefined.' What's the best way to have the data show? var app = angular.module('myApp',…
Squirrl
  • 4,909
  • 9
  • 47
  • 85
0
votes
1 answer

Are directives/instructions executed at runtime or assembly time?

I'm pretty new to assembly, and I'm wondering when directives and instructions are executed respectively?
123
  • 8,733
  • 14
  • 57
  • 99
0
votes
2 answers

Angular Can't change ng-model form other directive

I need to change ng-model (currentPage) in pdfViewerToolbar directive by clicking on canvas in pdfViewer directive. The self.next function in controller is called when i clicking on canvas, but ng-model="currentPage" is not changed in…
johanson
  • 119
  • 3
  • 9
0
votes
2 answers

how to get compiled nodeValue from an angular element

The basic premise is that I'm trying to access the element's value attribute after it compiles and copy it into a variable. For example: if vm.datasource.data['+ i +'].HolidayName compiled into "Christmas" I want to grab that value and store it in…
Darien Lombardi
  • 105
  • 1
  • 7
0
votes
1 answer

$scope variable is undefined in directive isolated scope

So I know that there a various questions regarding this issue on SO. I have checked loads of them and tried various combinations and I still can't get my directive to render. Essentially I am trying to pass an integer to my directive in an…
rex
  • 3,133
  • 6
  • 35
  • 62
0
votes
1 answer

How to call a function to renders items in a `ng-repeat` directive?

I am writing a directive to output a list of items. Those items are meant to be read from a JSON somewhere. Now, I want to render each item accordingly to a method that would be passed to the directive. Then, in my template, I call the method,…
remio
  • 1,242
  • 2
  • 15
  • 36
1 2 3
99
100