angular-phoenix
Advanced tools
Comparing version 0.2.2 to 0.2.3
{ | ||
"name": "angular-phoenix", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"authors": [ | ||
@@ -5,0 +5,0 @@ "MikaAK <mikakalathil@gmail.com>" |
@@ -124,4 +124,4 @@ 'use strict'; | ||
PhoenixBase.Channel.prototype.leave = function () { | ||
var _oldLeave = angular.copy(phoenix.Channel.prototype.leave); | ||
PhoenixBase.Channel.prototype.leave = (function () { | ||
var _oldLeave = angular.copy(PhoenixBase.Channel.prototype.leave); | ||
@@ -133,3 +133,3 @@ return function leave() { | ||
}; | ||
}; | ||
})(); | ||
@@ -136,0 +136,0 @@ return { |
{ | ||
"name": "angular-phoenix", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "Native bindings for phoenix in angular", | ||
@@ -5,0 +5,0 @@ "main": "dist/angular-phoenix.js", |
@@ -26,2 +26,3 @@ Angular Phoenix | ||
PhoenixProvider.setUrl('ws//localhost:9000/ws') | ||
PhoenixProiver.setAutoJoin(false) // Phoenix will autojoin the socket unless this is called | ||
}]) | ||
@@ -53,3 +54,13 @@ ``` | ||
### Why add a promise? | ||
For things like UI-Router this allows you to join into a channel as a resolve property!! | ||
For things like UI-Router this allows you to join into a channel as a resolve property!! | ||
```javascript | ||
.state('chatRoom', { | ||
url: '/chatRoom/:id', | ||
resolve: { | ||
chatChannel: ['$stateParams', 'Phoenix', ($stateParams, Phoenix) => { | ||
return Phoenix.join(`chatRoom:${$stateParams.id}`).promise | ||
}] | ||
} | ||
}) | ||
``` | ||
@@ -56,0 +67,0 @@ ### Leaving a channel |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13320
73