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

On a directive, using controller, templateUrl, and pre/post link causes an error. #3493

Closed
jelbourn opened this issue Aug 7, 2013 · 1 comment

Comments

@jelbourn
Copy link
Member

jelbourn commented Aug 7, 2013

When creating a directive that has a controller, a templateUrl, and a compile function that returns a linking pre/post pair, an error is thrown.

The error does not occur if using template instead of templateUrl, if you use a single (post) link function, or if you omit the controller.

The error is "No controller: [directive name]"

http://jsbin.com/azomeh/4/edit

@stevenguan
Copy link

looks same with #3482.

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.

2 participants