Skip to content

Instantly share code, notes, and snippets.

@swiz
Created March 26, 2010 02:38
Show Gist options
  • Save swiz/344414 to your computer and use it in GitHub Desktop.
Save swiz/344414 to your computer and use it in GitHub Desktop.
Code samples for Dependency Injection wiki page
[Inject( source="userModel.currentMode", destination="modeViewStack.selectedIndex" )]
[Inject( source="userModel.currentUser" )]
public var currentUser:User;
[Inject( source="userService" )]
public var service:RemoteObject;
...
// will inject this from BeanProvider
<mx:RemoteObject id="userService" />
[Inject]
public var model:IUserModel;
[Inject]
public function setModel( model:UserModel ):void
{
this.model = model;
}
[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