Linked Questions

95 votes
2 answers
56k views

I have a directive with an isolate-scope (so that I can reuse the directive in other places), and when I use this directive with an ng-repeat, it fails to work. I have read all the documentation and ...
Deepak Nulu's user avatar
39 votes
7 answers
64k views

So I have this directive called say, mySave, it's pretty much just this app.directive('mySave', function($http) { return function(scope, element, attrs) { element.bind("click", function() { ...
fxck's user avatar
  • 4,908
26 votes
10 answers
79k views

I have places in my code where I have this: <input data-ng-disabled="SOME_SCOPE_VARIABLE" /> I would like to be able to use it like this too: <input data-ng-autofocus="SOME_SCOPE_VARIABLE" /...
Mathew Berg's user avatar
  • 28.8k
15 votes
5 answers
66k views

If I have an AngularJS directive without a template and I want it to set a property on the current scope, what is the best way to do it? For example, a directive that counts button clicks: <...
David Faivre's user avatar
  • 2,352
23 votes
4 answers
21k views

I have a directive that I use like this: <dir model="data"></dir> The directive has an isolated scope. scope :{ model:'=' } Now I'm trying to use ng-show on that directive using ...
Sylvain's user avatar
  • 19.3k
22 votes
4 answers
27k views

I am creating simple ui-datetime directive. It splits javascript Date object into _date, _hours and _minutes parts. _date uses jquery ui datepicker, _hours and _minutes - number inputs. angular....
Artem Andreev's user avatar
19 votes
1 answer
8k views

I'm trying to apply the ng-style attribute on a custom directive tag, kind of like so: <my-directive ng-style="myStyle"></my-directive> Inside the controller I have: $scope.myStyle = { ...
sthomps's user avatar
  • 4,890
7 votes
2 answers
5k views

All my directives use the same scope and I want my directives to operate by their own. Directive: app.directive('headerSort', function () { return { restrict: 'A', controller: ...
Martijn's user avatar
  • 24.9k
3 votes
3 answers
8k views

I have this piece of code which allows a user to leave comments on a list of items. I created a directive and listen to keydown in order to let the user submit a comment if keyCode == 13. Not sure ...
John's user avatar
  • 3,839
0 votes
2 answers
3k views

I'm creating two directives which use the same controller, as a result I see that both directives share data among controller. What I want is that data to be UNIQUE per directive, so data shouldn't be ...
Manjar's user avatar
  • 3,278
5 votes
1 answer
2k views

Why formatters does not work with isolated scope? Is this angular bug or I am doing something wrong? This contains isolates scope and does not work: http://jsfiddle.net/YbdXQ/56/ restrict: 'A', ...
SunnyShah's user avatar
  • 30.6k
7 votes
1 answer
5k views

I did a lot of workaround, searched and researched, but I can't figure how to achieve my goal. - The problem: I have a the following situation, I want to avoid the user can overlap commissions dates ...
EPotignano's user avatar
2 votes
3 answers
3k views

Hi I have a two popup directives on the same page. The problem is when I click on one they both pop up. How can I isolate each scope from each other so only the popup that's clicked pops up? HTML &...
otissv's user avatar
  • 945
2 votes
2 answers
2k views

All: Suppose I have two directives( dir1 and dir2) , which are both isolated scope. From some posts, I learnt that I need to use "require" to get scope of the other directive, but there is one ...
Kuan's user avatar
  • 11.4k
2 votes
3 answers
2k views

I am trying to write custom directive and one of the requirements is that I should be able to disable one of the elements based on the expression set on attribute of the directive. Directive is ...
epitka's user avatar
  • 17.6k

15 30 50 per page