diff options
| -rw-r--r-- | src/services.js | 15 | ||||
| -rw-r--r-- | test/servicesSpec.js | 10 | 
2 files changed, 1 insertions, 24 deletions
| diff --git a/src/services.js b/src/services.js index f9133aca..0b5923c6 100644 --- a/src/services.js +++ b/src/services.js @@ -15,7 +15,7 @@ angularServiceInject("$document", function(window){  angularServiceInject("$location", function(browser) {    var scope = this, -      location = {toString:toString, update:update, updateHash: updateHash, cancel: cancel}, +      location = {toString:toString, update:update, updateHash: updateHash},        lastLocationHref = browser.getUrl(),        lastLocationHash; @@ -101,19 +101,6 @@ angularServiceInject("$location", function(browser) {      return location.href;    } -  /** -   * Cancel change of the location -   * -   * Calling update(), updateHash() or setting a property does not immediately -   * change the browser's url. Url is changed at the end of $eval() -   * -   * By calling this method, you can cancel the change (before end of $eval()) -   * -   */ -  function cancel() { -    update(lastLocationHref); -  } -    // INNER METHODS    /** diff --git a/test/servicesSpec.js b/test/servicesSpec.js index 77ad59df..cf45becb 100644 --- a/test/servicesSpec.js +++ b/test/servicesSpec.js @@ -227,16 +227,6 @@ describe("service", function(){        expect(scope.$location.hash).toEqual('path?a=b');        expect(scope.$location.hashSearch).toEqual({a: 'b'});        expect(scope.$location.hashPath).toEqual('path'); -    }); -     -    it('should not update browser if you call cancel()', function() { -      spyOn($browser, 'setUrl'); -       -      scope.$location.update('http://www.angularjs.org/a/b#a/b'); -      scope.$location.cancel(); -      scope.$eval(); - -      expect($browser.setUrl).not.toHaveBeenCalled();      });        }); | 
