aboutsummaryrefslogtreecommitdiffstats
path: root/alias-angular/app
diff options
context:
space:
mode:
authorGuillaume Horel <guillaume.horel@gmail.com>2012-04-02 03:23:26 -0400
committerGuillaume Horel <guillaume.horel@gmail.com>2012-04-02 03:23:26 -0400
commitd3cfd925dc6ffa1cfa9e410e7d725f765265a7f2 (patch)
treea14fc74e87caa436490cd1ad745f0c97108c95a2 /alias-angular/app
parente01b2d668de12f86c2a5b1950a63b6a8055e1f90 (diff)
downloadalias-d3cfd925dc6ffa1cfa9e410e7d725f765265a7f2.tar.gz
still not sending the stanza
Diffstat (limited to 'alias-angular/app')
-rw-r--r--alias-angular/app/js/controllers.js13
-rw-r--r--alias-angular/app/js/services.js10
2 files changed, 11 insertions, 12 deletions
diff --git a/alias-angular/app/js/controllers.js b/alias-angular/app/js/controllers.js
index 4199c7f..a4bc0d3 100644
--- a/alias-angular/app/js/controllers.js
+++ b/alias-angular/app/js/controllers.js
@@ -1,12 +1,8 @@
'use strict';
/* App Controllers */
-function RosterCtl($scope, connection) {
+function RosterCtl($scope, connection, $log) {
$scope.contacts = [];
- $scope.init = function() {
- var query = $iq({type : 'get'}).c('query', {xmlns : Strophe.NS.ROSTER});
- connection.sendIQ(query, success);
- };
$scope.onRoster = function(iq) {
var elems = iq.getElementsByTagName('query');
var query = elems[0];
@@ -17,5 +13,8 @@ function RosterCtl($scope, connection) {
});
return true;
};
-};
-RosterCtl.$inject = ['$scope','connection']; \ No newline at end of file
+ $log.log('sending the stanza');
+ var query = $iq({type : 'get'}).c('query', {xmlns : Strophe.NS.ROSTER});
+ connection.sendIQ(query, $scope.onRoster);
+ };
+RosterCtl.$inject = ['$scope','connection','$log']; \ No newline at end of file
diff --git a/alias-angular/app/js/services.js b/alias-angular/app/js/services.js
index 02d8a8b..26113cb 100644
--- a/alias-angular/app/js/services.js
+++ b/alias-angular/app/js/services.js
@@ -5,15 +5,15 @@ $provide.factory('connection',
['$log', function($log) {
function connect_callback(status){
if ( status == Strophe.Status.CONNECTING ) {
- $log('Strophe is connecting.');
+ $log.log('Strophe is connecting.');
} else if ( status == Strophe.Status.CONNFAIL ) {
- $log('Strophe failed to connect.');
+ $log.log('Strophe failed to connect.');
} else if ( status == Strophe.Status.DISCONNECTING ) {
- $log('Strophe is disconnecting.');
+ $log.log('Strophe is disconnecting.');
} else if ( status == Strophe.Status.DISCONNECTED ) {
- $dev.log('Strophe is disconnected.');
+ $log.log('Strophe is disconnected.');
} else if ( status == Strophe.Status.CONNECTED ) {
- $log('Strophe is connected.');
+ $log.log('Strophe is connected.');
}
};
var connection = new Strophe.Connection(BOSH_SERVICE);