This repository was archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.4k
$onInit
and friends
#13763
Closed
Closed
$onInit
and friends
#13763
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
50b0c1a
feat($compile): call `$ngOnInit` on directive controllers after contr…
petebacondarwin cf4e7be
test($compile): check that $onInit is called correctly for ES6 classes
petebacondarwin 452dd39
docs($compile): document the new `$onInit` controller hook
petebacondarwin f72ecbd
feat($compile): allow `require` to be an object
petebacondarwin b2c0b05
feat($compile): allow required controllers to be bound to the directi…
petebacondarwin 37793ce
feat($compile): allow `require` to be an object
petebacondarwin a12ddc6
test($compile): check explicit return controllers are not broken by b…
petebacondarwin 59feecc
feat($compile): allow required controllers to be bound to the directi…
petebacondarwin 8040bab
feat($compile): call `$ngOnInit` on directive controllers after contr…
petebacondarwin 9e6db1a
feat($compile): allow required controllers to be bound to the directi…
petebacondarwin 1d18df2
fix($compile): ensure controllers with return value constructors are …
petebacondarwin 4b304a6
docs($compile): squash me
petebacondarwin cae40ca
fix($compile): only bind required controllers if `bindToController` i…
petebacondarwin 276b9ee
docs($compile): fix typo
petebacondarwin 6d66a75
fix($compile): only bind required controllers if `bindToController` i…
petebacondarwin 32b7da3
test($compile): check that $onInit is called correctly for ES6 classes
petebacondarwin cb495a5
fix($compile): only bind required controllers if `bindToController` i…
petebacondarwin 270e230
fix($compile): ensure controllers with return value constructors are …
petebacondarwin 281d987
fix($compile): only bind required controllers if `bindToController` i…
petebacondarwin 9f76a11
test($compile): check that $onInit is called correctly for ES6 classes
petebacondarwin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat($compile): allow required controllers to be bound to the directi…
…ve controller If directives are required through an object hash, rather than a string or array, the required directives' controllers are bound to the current directive's controller in much the same way as the properties are bound to using `bindToController`. The binding is done after the controller has been constructed and all the bindings are guaranteed to be complete by the time the controller's `$onInit` method is called. This change makes it much simpler to access require controllers without the need for manually wiring them up in link functions. In particular this enables support for `require` in directives defined using `mod.component()`
- Loading branch information
commit 9e6db1a267f505c793c49c73631a602ddcf6e98b
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should note that the controllers are only available once $onInit has been called, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated