mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-18 07:50:22 +00:00
26 lines
387 B
JavaScript
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();
|
|
});
|