From 8a000a586dd22b3d522ae060a4716184006d7d9e Mon Sep 17 00:00:00 2001 From: Josh Taylor Date: Tue, 13 Aug 2013 09:49:29 -0700 Subject: style($route): make some jshint recommended changes Syntax changes: - ternary indentation - remove unused variable, N - use triple equals instead of double Closes #3559 --- src/ngRoute/route.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/ngRoute/route.js') diff --git a/src/ngRoute/route.js b/src/ngRoute/route.js index f8a285cd..117e7abf 100644 --- a/src/ngRoute/route.js +++ b/src/ngRoute/route.js @@ -16,7 +16,7 @@ *
  * angular.module('App', ['ngRoute']);
  * 
- * + * */ var ngRouteModule = angular.module('ngRoute', ['ng']). @@ -47,8 +47,8 @@ function $RouteProvider(){ * * `path` can contain named groups starting with a colon (`:name`). All characters up * to the next slash are matched and stored in `$routeParams` under the given `name` * when the route matches. - * * `path` can contain named groups starting with a colon and ending with a star (`:name*`). - * All characters are eagerly stored in `$routeParams` under the given `name` + * * `path` can contain named groups starting with a colon and ending with a star (`:name*`). + * All characters are eagerly stored in `$routeParams` under the given `name` * when the route matches. * * `path` can contain optional named groups with a question mark (`:name?`). * @@ -139,8 +139,8 @@ function $RouteProvider(){ // create redirection for trailing slashes if (path) { var redirectPath = (path[path.length-1] == '/') - ? path.substr(0, path.length-1) - : path +'/'; + ? path.substr(0, path.length-1) + : path +'/'; routes[redirectPath] = extend( {redirectTo: path}, @@ -439,13 +439,12 @@ function $RouteProvider(){ var m = route.regexp.exec(on); if (!m) return null; - var N = 0; for (var i = 1, len = m.length; i < len; ++i) { var key = keys[i - 1]; var val = 'string' == typeof m[i] - ? decodeURIComponent(m[i]) - : m[i]; + ? decodeURIComponent(m[i]) + : m[i]; if (key && val) { params[key.name] = val; @@ -552,7 +551,7 @@ function $RouteProvider(){ function interpolate(string, params) { var result = []; forEach((string||'').split(':'), function(segment, i) { - if (i == 0) { + if (i === 0) { result.push(segment); } else { var segmentMatch = segment.match(/(\w+)(.*)/); -- cgit v1.2.3