Skip to content
This repository was archived by the owner on May 26, 2023. It is now read-only.

Commit d057952

Browse files
chore(tslint): no-shadowed-variable
1 parent 50c06a7 commit d057952

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

src/directives/stateDirectives.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,8 @@ function bindEvents(element: IAugmentedJQuery, scope: IScope, hookFn: (e: JQuery
254254
* - Unlike the parameter values expression, the state name is not `$watch`ed (for performance reasons).
255255
* If you need to dynamically update the state being linked to, use the fully dynamic [[uiState]] directive.
256256
*/
257-
let uiSref: ng1_directive;
258-
uiSref = ['$uiRouter', '$timeout',
257+
let uiSrefDirective: ng1_directive;
258+
uiSrefDirective = ['$uiRouter', '$timeout',
259259
function $StateRefDirective($uiRouter: UIRouter, $timeout: ITimeoutService) {
260260
let $state = $uiRouter.stateService;
261261

@@ -386,8 +386,8 @@ uiSref = ['$uiRouter', '$timeout',
386386
* - A middle-click, right-click, or ctrl-click is handled (natively) by the browser to open the href in a new window, for example.
387387
* ```
388388
*/
389-
let uiState: ng1_directive;
390-
uiState = ['$uiRouter', '$timeout',
389+
let uiStateDirective: ng1_directive;
390+
uiStateDirective = ['$uiRouter', '$timeout',
391391
function $StateRefDynamicDirective($uiRouter: UIRouter, $timeout: ITimeoutService) {
392392
let $state = $uiRouter.stateService;
393393

@@ -519,8 +519,8 @@ uiState = ['$uiRouter', '$timeout',
519519
*
520520
* - Multiple classes may be specified in a space-separated format: `ui-sref-active='class1 class2 class3'`
521521
*/
522-
let uiSrefActive: ng1_directive;
523-
uiSrefActive = ['$state', '$stateParams', '$interpolate', '$uiRouter',
522+
let uiSrefActiveDirective: ng1_directive;
523+
uiSrefActiveDirective = ['$state', '$stateParams', '$interpolate', '$uiRouter',
524524
function $StateRefActiveDirective($state: StateService, $stateParams: Obj, $interpolate: IInterpolateService, $uiRouter: UIRouter) {
525525
return {
526526
restrict: "A",
@@ -621,7 +621,7 @@ interface Def { uiState: string; href: string; uiStateParams: Obj; uiStateOpts:
621621
interface StateData { state: StateDeclaration; params: RawParams; activeClass: string; }
622622

623623
angular.module('ui.router.state')
624-
.directive('uiSref', uiSref)
625-
.directive('uiSrefActive', uiSrefActive)
626-
.directive('uiSrefActiveEq', uiSrefActive)
627-
.directive('uiState', uiState);
624+
.directive('uiSref', uiSrefDirective)
625+
.directive('uiSrefActive', uiSrefActiveDirective)
626+
.directive('uiSrefActiveEq', uiSrefActiveDirective)
627+
.directive('uiState', uiStateDirective);

src/locationServices.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ export class Ng1LocationServices implements LocationConfig, LocationServices {
4141
static monkeyPatchPathParameterType(router: UIRouter) {
4242
let pathType: ParamType = router.urlMatcherFactory.type('path');
4343

44-
pathType.encode = (val: any) =>
45-
val != null ? val.toString().replace(/(~|\/)/g, m => ({ '~': '~~', '/': '~2F' }[m])) : val;
44+
pathType.encode = (x: any) =>
45+
x != null ? x.toString().replace(/(~|\/)/g, m => ({ '~': '~~', '/': '~2F' }[m])) : x;
4646

47-
pathType.decode = (val: string) =>
48-
val != null ? val.toString().replace(/(~~|~2F)/g, m => ({ '~~': '~', '~2F': '/' }[m])) : val;
47+
pathType.decode = (x: string) =>
48+
x != null ? x.toString().replace(/(~~|~2F)/g, m => ({ '~~': '~', '~2F': '/' }[m])) : x;
4949

5050
}
5151

src/services.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ let mod_main = angular.module('ui.router', ['ui.router.init', 'ui.router
3535
let mod_cmpt = angular.module('ui.router.compat', ['ui.router']); // tslint:disable-line
3636

3737
declare module '@uirouter/core/lib/router' {
38-
interface UIRouter {
38+
interface UIRouter { // tslint:disable-line:no-shadowed-variable
3939
/** @hidden */
4040
stateProvider: StateProvider;
4141
/** @hidden */
@@ -45,9 +45,9 @@ declare module '@uirouter/core/lib/router' {
4545

4646
let router: UIRouter = null;
4747

48-
$uiRouter.$inject = ['$locationProvider'];
48+
$uiRouterProvider.$inject = ['$locationProvider'];
4949
/** This angular 1 provider instantiates a Router and exposes its services via the angular injector */
50-
function $uiRouter($locationProvider: ILocationProvider) {
50+
function $uiRouterProvider($locationProvider: ILocationProvider) {
5151

5252
// Create a new instance of the Router when the $uiRouterProvider is initialized
5353
router = this.router = new UIRouter();
@@ -113,7 +113,7 @@ export function watchDigests($rootScope: IRootScopeService) {
113113
$rootScope.$watch(function() { trace.approximateDigests++; });
114114
}
115115

116-
mod_init .provider("$uiRouter", <any> $uiRouter);
116+
mod_init .provider("$uiRouter", <any> $uiRouterProvider);
117117
mod_rtr .provider('$urlRouter', ['$uiRouterProvider', getUrlRouterProvider]);
118118
mod_util .provider('$urlService', getProviderFor('urlService'));
119119
mod_util .provider('$urlMatcherFactory', ['$uiRouterProvider', () => router.urlMatcherFactory]);

src/statebuilders/onEnterExitRetain.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import { Ng1StateDeclaration } from '../interface';
1313
* ensures that those hooks are injectable for @uirouter/angularjs (ng1).
1414
*/
1515
export const getStateHookBuilder = (hookName: "onEnter"|"onExit"|"onRetain") =>
16-
function stateHookBuilder(state: StateObject, parentFn: BuilderFunction): TransitionStateHookFn {
17-
const hook = state[hookName];
16+
function stateHookBuilder(stateObject: StateObject, parentFn: BuilderFunction): TransitionStateHookFn {
17+
const hook = stateObject[hookName];
1818
const pathname = hookName === 'onExit' ? 'from' : 'to';
1919

2020
function decoratedNg1Hook(trans: Transition, state: Ng1StateDeclaration): HookResult {

0 commit comments

Comments
 (0)