angular.js/test/angular-mocks.js

27 lines
387 B
JavaScript
Raw Normal View History

2010-04-05 18:46:53 +00:00
function MockBrowser() {
this.url = "http://server";
this.watches = [];
}
MockBrowser.prototype = {
xhr: function(method, url, callback) {
},
getUrl: function(){
return this.url;
},
setUrl: function(url){
this.url = url;
},
watchUrl: function(fn) {
this.watches.push(fn);
}
};
angular.service('$browser', function(){
return new MockBrowser();
});