diff options
| author | Guillaume Horel <guillaume.horel@gmail.com> | 2012-04-02 02:37:41 -0400 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@gmail.com> | 2012-04-02 02:37:41 -0400 |
| commit | 28a5d4fbf8a42649360e9d1e1206c062e0a5ce8d (patch) | |
| tree | 0c0842aab6ca8259f14fc9b760eb742098fa1aaa /alias-angular/app/js/services.js | |
| parent | 0a74881345b16b39487493364bb0c24f8cc47967 (diff) | |
| download | alias-28a5d4fbf8a42649360e9d1e1206c062e0a5ce8d.tar.gz | |
regorg files
Diffstat (limited to 'alias-angular/app/js/services.js')
| -rw-r--r-- | alias-angular/app/js/services.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/alias-angular/app/js/services.js b/alias-angular/app/js/services.js new file mode 100644 index 0000000..02d8a8b --- /dev/null +++ b/alias-angular/app/js/services.js @@ -0,0 +1,23 @@ +'use strict'; + +angular.module('Alias.services', [], function($provide) { +$provide.factory('connection', + ['$log', function($log) { + function connect_callback(status){ + if ( status == Strophe.Status.CONNECTING ) { + $log('Strophe is connecting.'); + } else if ( status == Strophe.Status.CONNFAIL ) { + $log('Strophe failed to connect.'); + } else if ( status == Strophe.Status.DISCONNECTING ) { + $log('Strophe is disconnecting.'); + } else if ( status == Strophe.Status.DISCONNECTED ) { + $dev.log('Strophe is disconnected.'); + } else if ( status == Strophe.Status.CONNECTED ) { + $log('Strophe is connected.'); + } + }; + var connection = new Strophe.Connection(BOSH_SERVICE); + connection.connect(NAME, PASSWORD, connect_callback); + return connection; + }]); +});
\ No newline at end of file |
