This repository has been archived by the owner on Feb 22, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(scope): component is the new context
BREAKING CHANGE: Scope context is set to the component instance that trigged the creation of the scope (previously it was of a PrototypeMap.) Repercussions: 1) You can not inject a scope in a component or in the root context any more. As the Scope context is set to the Component instance, the scope could not be injected any more. Components should implements the "ScopeAware" interface and declare a "scope" setter in order to get a reference to the scope. before: @component(...) class MyComponent { Watch watch; Scope scope; MyComponent(Dependency myDep, Scope scope) { watch = scope.rootScope.watch("expression", (v, p) => ...); } } after: @component(...) class MyComponent implements ScopeAware { Watch watch; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } void set scope(Scope scope) { // This setter gets called to initialize the scope watch = scope.watch("expression", (v, p) => ...); } } or: @component(...) class MyComponent implements ScopeAware { Scope scope; MyComponent(Dependency myDep) { // It is an error to add a Scope argument to the // ctor and will result in a DI circular dependency error // The scope is never accessible in the class constructor } } 2) The parent component to an NgForm must have a "$name" field to store the form instance. closes #919 closes #917
- Loading branch information
Showing
71 changed files
with
4,364 additions
and
665 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ dependencies: | |
path: ../ | ||
browser: any | ||
unittest: any | ||
quiver: any | ||
web_components: any | ||
|
||
transformers: | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.