@@ -227,18 +227,18 @@ it('should show example', inject(
227
227
},
228
228
function($location) {
229
229
// open http://example.com/base/index.html#!/a
230
- $location.absUrl() == 'http://example.com/base/index.html#!/a'
231
- $location.path() == '/a'
230
+ $location.absUrl() === 'http://example.com/base/index.html#!/a'
231
+ $location.path() === '/a'
232
232
233
233
$location.path('/foo')
234
- $location.absUrl() == 'http://example.com/base/index.html#!/foo'
234
+ $location.absUrl() === 'http://example.com/base/index.html#!/foo'
235
235
236
- $location.search() == {}
236
+ $location.search() === {}
237
237
$location.search({a: 'b', c: true});
238
- $location.absUrl() == 'http://example.com/base/index.html#!/foo?a=b&c'
238
+ $location.absUrl() === 'http://example.com/base/index.html#!/foo?a=b&c'
239
239
240
240
$location.path('/new').search('x=y');
241
- $location.absUrl() == 'http://example.com/base/index.html#!/new?x=y'
241
+ $location.absUrl() === 'http://example.com/base/index.html#!/new?x=y'
242
242
}
243
243
));
244
244
```
@@ -271,29 +271,29 @@ it('should show example', inject(
271
271
// in browser with HTML5 history support:
272
272
// open http://example.com/#!/a -> rewrite to http://example.com/a
273
273
// (replacing the http://example.com/#!/a history record)
274
- $location.path() == '/a'
274
+ $location.path() === '/a'
275
275
276
276
$location.path('/foo');
277
- $location.absUrl() == 'http://example.com/foo'
277
+ $location.absUrl() === 'http://example.com/foo'
278
278
279
- $location.search() == {}
279
+ $location.search() === {}
280
280
$location.search({a: 'b', c: true});
281
- $location.absUrl() == 'http://example.com/foo?a=b&c'
281
+ $location.absUrl() === 'http://example.com/foo?a=b&c'
282
282
283
283
$location.path('/new').search('x=y');
284
- $location.url() == 'new?x=y'
285
- $location.absUrl() == 'http://example.com/new?x=y'
284
+ $location.url() === 'new?x=y'
285
+ $location.absUrl() === 'http://example.com/new?x=y'
286
286
287
287
// in browser without html5 history support:
288
288
// open http://example.com/new?x=y -> redirect to http://example.com/#!/new?x=y
289
289
// (again replacing the http://example.com/new?x=y history item)
290
- $location.path() == '/new'
291
- $location.search() == {x: 'y'}
290
+ $location.path() === '/new'
291
+ $location.search() === {x: 'y'}
292
292
293
293
$location.path('/foo/bar');
294
- $location.path() == '/foo/bar'
295
- $location.url() == '/foo/bar?x=y'
296
- $location.absUrl() == 'http://example.com/#!/foo/bar?x=y'
294
+ $location.path() === '/foo/bar'
295
+ $location.url() === '/foo/bar?x=y'
296
+ $location.absUrl() === 'http://example.com/#!/foo/bar?x=y'
297
297
}
298
298
));
299
299
```
@@ -411,9 +411,9 @@ In these examples we use `<base href="/base/index.html" />`. The inputs represen
411
411
412
412
.controller("LocationController", function($scope, $location) {
413
413
$scope.$location = {};
414
- angular.forEach("protocol host port path search hash".split(" "), function(method){
415
- $scope.$location[method] = function(){
416
- var result = $location[method].call ($location);
414
+ angular.forEach("protocol host port path search hash".split(" "), function(method) {
415
+ $scope.$location[method] = function() {
416
+ var result = $location[method]($location);
417
417
return angular.isObject(result) ? angular.toJson(result) : result;
418
418
};
419
419
});
@@ -460,7 +460,7 @@ In these examples we use `<base href="/base/index.html" />`. The inputs represen
460
460
.directive('ngAddressBar', function($browser, $timeout) {
461
461
return {
462
462
template: 'Address: <input id="addressBar" type="text" style="width: 400px" >',
463
- link: function(scope, element, attrs){
463
+ link: function(scope, element, attrs) {
464
464
var input = element.children("input"), delay;
465
465
466
466
input.on('keypress keyup keydown', function(event) {
@@ -488,7 +488,7 @@ In these examples we use `<base href="/base/index.html" />`. The inputs represen
488
488
url = 'http://www.example.com/base/path?a=b#h';
489
489
490
490
491
- it("should show fake browser info on load", function(){
491
+ it("should show fake browser info on load", function() {
492
492
expect(addressBar.getAttribute('value')).toBe(url);
493
493
494
494
expect(element(by.binding('$location.protocol()')).getText()).toBe('http');
@@ -500,7 +500,7 @@ In these examples we use `<base href="/base/index.html" />`. The inputs represen
500
500
501
501
});
502
502
503
- it("should change $location accordingly", function(){
503
+ it("should change $location accordingly", function() {
504
504
var navigation = element.all(by.css("#navigation a"));
505
505
506
506
navigation.get(0).click();
@@ -565,9 +565,9 @@ In these examples we use `<base href="/base/index.html" />`. The inputs represen
565
565
566
566
.controller("LocationController", function($scope, $location) {
567
567
$scope.$location = {};
568
- angular.forEach("protocol host port path search hash".split(" "), function(method){
569
- $scope.$location[method] = function(){
570
- var result = $location[method].call ($location);
568
+ angular.forEach("protocol host port path search hash".split(" "), function(method) {
569
+ $scope.$location[method] = function() {
570
+ var result = $location[method]($location);
571
571
return angular.isObject(result) ? angular.toJson(result) : result;
572
572
};
573
573
});
@@ -614,7 +614,7 @@ In these examples we use `<base href="/base/index.html" />`. The inputs represen
614
614
.directive('ngAddressBar', function($browser, $timeout) {
615
615
return {
616
616
template: 'Address: <input id="addressBar" type="text" style="width: 400px" >',
617
- link: function(scope, element, attrs){
617
+ link: function(scope, element, attrs) {
618
618
var input = element.children("input"), delay;
619
619
620
620
input.on('keypress keyup keydown', function(event) {
@@ -641,7 +641,7 @@ In these examples we use `<base href="/base/index.html" />`. The inputs represen
641
641
var addressBar = element(by.css("#addressBar")),
642
642
url = 'http://www.example.com/base/index.html#!/path?a=b#h';
643
643
644
- it("should show fake browser info on load", function(){
644
+ it("should show fake browser info on load", function() {
645
645
expect(addressBar.getAttribute('value')).toBe(url);
646
646
647
647
expect(element(by.binding('$location.protocol()')).getText()).toBe('http');
@@ -653,7 +653,7 @@ In these examples we use `<base href="/base/index.html" />`. The inputs represen
653
653
654
654
});
655
655
656
- it("should change $location accordingly", function(){
656
+ it("should change $location accordingly", function() {
657
657
var navigation = element.all(by.css("#navigation a"));
658
658
659
659
navigation.get(0).click();
@@ -735,7 +735,7 @@ ng.$rootScope.Scope scope} life-cycle. This means it's your responsibility to ca
735
735
```js
736
736
describe('serviceUnderTest', function() {
737
737
beforeEach(module(function($provide) {
738
- $provide.factory('serviceUnderTest', function($location){
738
+ $provide.factory('serviceUnderTest', function($location) {
739
739
// whatever it does...
740
740
});
741
741
});
@@ -843,7 +843,7 @@ to bind it to `ngModel`:
843
843
<file name="script.js">
844
844
angular.module('locationExample', [])
845
845
.controller('LocationController', ['$scope', '$location', function($scope, $location) {
846
- $scope.locationPath = function (newLocation) {
846
+ $scope.locationPath = function(newLocation) {
847
847
return $location.path(newLocation);
848
848
};
849
849
}]);
0 commit comments