Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

ng-init directive priority #5167

Closed
bullgare opened this issue Nov 27, 2013 · 0 comments
Closed

ng-init directive priority #5167

bullgare opened this issue Nov 27, 2013 · 0 comments

Comments

@bullgare
Copy link
Contributor

Hello.
There's one more priority-related bug in 1.2.
1.2.2 is now ok when using controller on ng-include but there's one more related bug:
ng-init doesn't affect ng-include.
It can be fixed with setting it's priority higher than in include directive, like:

var ngInitDirective = ngDirective({
  priority: 401,
  compile: function() {
    return {
      pre: function(scope, element, attrs) {
        scope.$eval(attrs.ngInit);
      }
    };
  }
});

Jsbins:
with 1.2.2 - http://jsbin.com/oliGUvud/1/edit?html,output (digit 1 is not there)
with 1.0.8 - http://jsbin.com/EfudOZAF/1/edit?html,output (digit 1 is there)

@ghost ghost assigned IgorMinar Dec 2, 2013
jamesdaily pushed a commit to jamesdaily/angular.js that referenced this issue Jan 27, 2014
The priority of ngInit is adjusted to occur before ngInclude, and after
ngController. This enables ngInit to initiallize values in a controller's
scope, and also to initiallize values before ngInclude executes.

Closes angular#5167
Closes angular#5208
jamesdaily pushed a commit to jamesdaily/angular.js that referenced this issue Jan 27, 2014
The priority of ngInit is adjusted to occur before ngInclude, and after
ngController. This enables ngInit to initiallize values in a controller's
scope, and also to initiallize values before ngInclude executes.

Closes angular#5167
Closes angular#5208
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.