mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-04-10 10:01:00 +00:00
27 lines
387 B
JavaScript
27 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();
|
||
|
|
});
|