Skip to content

Commit 75b06d6

Browse files
committed
Expose the ability to shutdown atmosphere
1 parent 432b452 commit 75b06d6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

app/scripts/services/angular-atmosphere.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@ angular.module('ngAtmosphere', [])
4848
}
4949
}
5050
},
51+
close: function () {
52+
if(connection){
53+
if (debug) {
54+
console.log('ngAtmosphere DEBUG: unsubscribing to ' + connection.getUrl());
55+
}
56+
$.atmosphere.unsubscribeUrl(connection.getUrl());
57+
}
58+
},
5159
on: function (type, callbackFn) {
5260

5361
var id = Math.random();
@@ -94,4 +102,4 @@ angular.module('ngAtmosphere', [])
94102
debug = enable;
95103
}
96104
};
97-
}]);
105+
}]);

0 commit comments

Comments
 (0)