SHARE
TWEET

Untitled

a guest Oct 12th, 2016 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. angular.module('angularDemo.messagingFactory', []).factory("messagingService", messagingService);
  2.  
  3. function messagingService($rootscope, $scope) {
  4.   var factory = {};
  5.   factory.events=[];
  6.   var getEvent = function(eventName){
  7.     return factory.events[eventName];
  8.   };
  9.   factory.on = function(eventName, callback) {
  10.     var eventId = factory.getEventId();
  11.  
  12.   };
  13.  
  14.   factory.emit = function(eventName, data, callback) {
  15.     factory.events.push({
  16.       "eventName": eventName,
  17.       "data", data,
  18.       "callback": callback
  19.     });
  20.   };
  21.   return factory;
  22. }
  23.  
  24. messagingService.$inject = ['$rootscope', '$scope'];
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top