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

the prelink function won't be called if the directive has templateUrl and controller property also. #3482

Closed
stevenguan opened this issue Aug 6, 2013 · 1 comment

Comments

@stevenguan
Copy link

it may caused by set derivedSyncDirective with 'controller: null' in compileTemplateUrl.

controll is null cause 'getControllers' fail which is called in 'linkFn(scope, $element, attrs,linkFn.require && getControllers(linkFn.require, $element));'(nodeLinkFn).

if I remove this part the prelink will work. DOn't know why 'controller: null' there.

I create a demo here http://plnkr.co/edit/yMcurPowZmxCOv0luE5s?p=preview

@stevenguan
Copy link
Author

I use AngularJS v1.1.5

IgorMinar pushed a commit that referenced this issue Aug 9, 2013
Controllers should be always instantiated after compile fn runs, but before
pre-link fn runs. This way, controllers are available to pre-link fns that
request them.

Previously this was broken for async directives (directives with templateUrl).

Closes #3493
Closes #3482
Closes #3514
IgorMinar pushed a commit to IgorMinar/angular.js that referenced this issue Aug 10, 2013
This fixes regression introduced by angular#3514 (5c56011) - this commit is being
reverted here and a better fix is included.

The regression caused the controller to be instantiated before the isolate scope
was initialized.

Closes angular#3493
Closes angular#3482
Closes angular#3537
chirayuk added a commit that referenced this issue Aug 12, 2013
This fixes regression introduced by #3514 (5c56011) - this commit is being
reverted here and a better fix is included.

The regression caused the controller to be instantiated before the isolate scope
was initialized.

Closes #3493
Closes #3482
Closes #3537
Closes #3540
chirayuk added a commit to chirayuk/angular.js that referenced this issue Aug 21, 2013
This fixes regression introduced by angular#3514 (9c51d50) - this commit is being
reverted here and a better fix is included.

The regression caused the controller to be instantiated before the isolate scope
was initialized.

Closes angular#3493
Closes angular#3482
Closes angular#3537
Closes angular#3540
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant