diff --git a/angular-sails.min.js b/angular-sails.min.js new file mode 100644 index 0000000..5bad150 --- /dev/null +++ b/angular-sails.min.js @@ -0,0 +1 @@ +(function(e,t){"use strict";var n=e.module("ngSails",[]);n.service("$sails",["$rootScope",function(e){var n=t.connect(),r=false,i=null;n.on("connect",function(){r=true;if(typeof i==="function"){i();i=null}});n.on("disconnect",function(){r=false});return{reconnect:function(e,t){var s=function(){n.disconnect();if(n.socket!==undefined){n.socket.connect(e,t)}};if(r===true){s()}else{i=s}},disconnect:function(){n.disconnect()},emit:function(e,t){n.emit(e,t)},on:function(t,r){n.on(t,function(){var t=arguments;e.$apply(function(){r.apply(n,t)})})},get:function(t,r){n.get(t,function(){var t=arguments;e.$apply(function(){r.apply(n,t)})})},post:function(t,r,i){n.post(t,r,function(){var t=arguments;e.$apply(function(){i.apply(n,t)})})},put:function(t,r,i){n.put(t,r,function(){var t=arguments;e.$apply(function(){i.apply(n,t)})})},"delete":function(t,r,i){n.delete(t,r,function(){var t=arguments;e.$apply(function(){i.apply(n,t)})})}}}])})(angular,io) \ No newline at end of file