Created
November 22, 2014 11:52
-
-
Save stevenh77/4a88194a21dbfae5806f to your computer and use it in GitHub Desktop.
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
| // publishing up the scope chain | |
| $scope.$emit('eventWithString', 'message'); | |
| // publishing down the scope chain | |
| $scope.$broadcast('eventWithObject', { | |
| text: 'message' | |
| }); | |
| // event subscription | |
| $scope.$on('eventWithObject', function (event, data) { | |
| console.log(data.text); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment