refactor($location): minor changes (unused deps, exported globals, unused deps, etc)

This commit is contained in:
George Kalpakas
2018-07-19 18:10:11 +03:00
parent c133ef8360
commit a07191727d
2 changed files with 6 additions and 5 deletions
+1
View File
@@ -1,4 +1,5 @@
'use strict';
/* global stripHash: true */
var PATH_MATCH = /^([^?#]*)(\?([^#]*))?(#(.*))?$/,
DEFAULT_PORTS = {'http': 80, 'https': 443, 'ftp': 21};
+5 -5
View File
@@ -693,10 +693,10 @@ describe('$location', function() {
describe('location watch', function() {
it('should not update browser if only the empty hash fragment is cleared by updating the search', function() {
it('should not update browser if only the empty hash fragment is cleared', function() {
initService({supportHistory: true});
mockUpBrowser({initialUrl:'http://new.com/a/b#', baseHref:'/base/'});
inject(function($rootScope, $browser, $location) {
mockUpBrowser({initialUrl: 'http://new.com/a/b#', baseHref: '/base/'});
inject(function($browser, $rootScope) {
$browser.url('http://new.com/a/b');
var $browserUrl = spyOnlyCallsWithArgs($browser, 'url').and.callThrough();
$rootScope.$digest();
@@ -707,8 +707,8 @@ describe('$location', function() {
it('should not replace browser url if only the empty hash fragment is cleared', function() {
initService({html5Mode: true, supportHistory: true});
mockUpBrowser({initialUrl:'http://new.com/#', baseHref: '/'});
inject(function($browser, $location) {
mockUpBrowser({initialUrl: 'http://new.com/#', baseHref: '/'});
inject(function($browser, $location, $window) {
expect($browser.url()).toBe('http://new.com/#');
expect($location.absUrl()).toBe('http://new.com/');
});