angular.js/test/angular-mocks.js
2010-04-05 11:46:53 -07:00

26 lines
387 B
JavaScript

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();
});