Created
December 1, 2015 10:29
-
-
Save mserranom/0fa5391d312d36dc8b45 to your computer and use it in GitHub Desktop.
container-ts example
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
export class NotificationsStore { | |
@Inject('repository') // injection by id | |
documentRepository : DocumentRepository; | |
private notifications : Array<Notifications>; | |
@PostConstruct | |
init() { | |
// invoked after all injections have been resolved | |
console.log('NotificationsStore initialised'); | |
this.documentRepository.fetch('notifications') | |
.then((data) => this.notifications = data); | |
} | |
@Destroy | |
destroy() { | |
console.log('NotificationsStore destroyed'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment