Last active
August 29, 2015 14:18
-
-
Save davidstump/fc8544865837f6aa99af to your computer and use it in GitHub Desktop.
NGService Example
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
class Thing extends @NGService | |
@$inject: [] | |
edit: (id) -> | |
@notify "thing:edit", id | |
reload: -> | |
@notify "thing:reload" | |
class FirstController extends @NGController | |
@$inject: ['Thing'] | |
doSomething: -> | |
@Thing.edit(1) | |
class SecondController extends @NGController | |
@$inject: ['Thing'] | |
init: -> | |
@Thing.on "thing:edit", (data) -> | |
# stuff |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment