Created
March 26, 2010 02:38
-
-
Save swiz/344414 to your computer and use it in GitHub Desktop.
Code samples for Dependency Injection wiki page
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
[Inject( source="userModel.currentMode", destination="modeViewStack.selectedIndex" )] |
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
[Inject( source="userModel.currentUser" )] | |
public var currentUser:User; |
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
[Inject( source="userService" )] | |
public var service:RemoteObject; | |
... | |
// will inject this from BeanProvider | |
<mx:RemoteObject id="userService" /> |
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
[Inject] | |
public var model:IUserModel; |
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
[Inject] | |
public function setModel( model:UserModel ):void | |
{ | |
this.model = model; | |
} |
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
[Bindable] | |
[Inject( source="userModel.currentUser", twoWay="true" )] | |
public var currentUser:User; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment