Created
November 27, 2015 11:04
-
-
Save MagnusThor/8d8a9430f18a3bbcfe43 to your computer and use it in GitHub Desktop.
Just a thing
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
angular.module("myApp").factory("await", [ | |
function() { | |
this.awaits = {}; | |
this.await = function (what, fn) { | |
this.awaits[what] = fn; | |
return this; | |
}; | |
this.fire = function (what, data) { | |
if (this.awaits.hasOwnProperty(what)) { | |
this.awaits[what].apply(this,[data]); | |
} | |
}; | |
return this; | |
} | |
]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment