Created
September 2, 2014 22:04
-
-
Save atticoos/08e5600e145a83da1ee4 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
| function MyService () { | |
| var sharableData = []; | |
| return { | |
| data: sharableData, | |
| doSomething: function () { | |
| webSocket.on('gettinData', function (data) { | |
| sharableData.push(data); | |
| }); | |
| } | |
| }; | |
| } | |
| function MyController (MyService) { | |
| $scope.packetData = MyService.data; | |
| // maybe fire of some initializing to the service.. | |
| // MyService.startFetchingData(); // etc... | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment