Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 8a000a5

Browse files
joshrtayIgorMinar
authored andcommitted
style($route): make some jshint recommended changes
Syntax changes: - ternary indentation - remove unused variable, N - use triple equals instead of double Closes #3559
1 parent dba5e16 commit 8a000a5

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/ngRoute/route.js

+8-9
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* <pre>
1717
* angular.module('App', ['ngRoute']);
1818
* </pre>
19-
*
19+
*
2020
*/
2121

2222
var ngRouteModule = angular.module('ngRoute', ['ng']).
@@ -47,8 +47,8 @@ function $RouteProvider(){
4747
* * `path` can contain named groups starting with a colon (`:name`). All characters up
4848
* to the next slash are matched and stored in `$routeParams` under the given `name`
4949
* when the route matches.
50-
* * `path` can contain named groups starting with a colon and ending with a star (`:name*`).
51-
* All characters are eagerly stored in `$routeParams` under the given `name`
50+
* * `path` can contain named groups starting with a colon and ending with a star (`:name*`).
51+
* All characters are eagerly stored in `$routeParams` under the given `name`
5252
* when the route matches.
5353
* * `path` can contain optional named groups with a question mark (`:name?`).
5454
*
@@ -139,8 +139,8 @@ function $RouteProvider(){
139139
// create redirection for trailing slashes
140140
if (path) {
141141
var redirectPath = (path[path.length-1] == '/')
142-
? path.substr(0, path.length-1)
143-
: path +'/';
142+
? path.substr(0, path.length-1)
143+
: path +'/';
144144

145145
routes[redirectPath] = extend(
146146
{redirectTo: path},
@@ -439,13 +439,12 @@ function $RouteProvider(){
439439
var m = route.regexp.exec(on);
440440
if (!m) return null;
441441

442-
var N = 0;
443442
for (var i = 1, len = m.length; i < len; ++i) {
444443
var key = keys[i - 1];
445444

446445
var val = 'string' == typeof m[i]
447-
? decodeURIComponent(m[i])
448-
: m[i];
446+
? decodeURIComponent(m[i])
447+
: m[i];
449448

450449
if (key && val) {
451450
params[key.name] = val;
@@ -552,7 +551,7 @@ function $RouteProvider(){
552551
function interpolate(string, params) {
553552
var result = [];
554553
forEach((string||'').split(':'), function(segment, i) {
555-
if (i == 0) {
554+
if (i === 0) {
556555
result.push(segment);
557556
} else {
558557
var segmentMatch = segment.match(/(\w+)(.*)/);

0 commit comments

Comments
 (0)