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

Commit c75051c

Browse files
chore(tslint): quotemark
1 parent e662d83 commit c75051c

17 files changed

+117
-117
lines changed

src/angular.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @module ng1
44
*/ /** */
55
declare var angular;
6-
import * as ng_from_import from "angular";
6+
import * as ng_from_import from 'angular';
77
const ng_from_global = angular;
88

99
export const ng = (ng_from_import && ng_from_import.module) ? ng_from_import : ng_from_global;

src/directives/stateDirectives.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
* @preferred
99
* @module directives
1010
*/ /** for typedoc */
11-
import { ng as angular } from "../angular";
12-
import { IAugmentedJQuery, ITimeoutService, IScope, IInterpolateService } from "angular";
11+
import { ng as angular } from '../angular';
12+
import { IAugmentedJQuery, ITimeoutService, IScope, IInterpolateService } from 'angular';
1313

1414
import {
1515
Obj, extend, forEach, tail, isString, isObject, isArray, parse, noop, unnestR, identity, uniqR, inArray, removeFrom,
1616
RawParams, PathNode, StateOrName, StateService, StateDeclaration, UIRouter
17-
} from "@uirouter/core";
18-
import { UIViewData } from "./viewDirective";
17+
} from '@uirouter/core';
18+
import { UIViewData } from './viewDirective';
1919

2020
/** @hidden Used for typedoc */
2121
export interface ng1_directive {} // tslint:disable-line:class-name
@@ -26,7 +26,7 @@ function parseStateRef(ref: string) {
2626
const paramsOnly = ref.match(/^\s*({[^}]*})\s*$/);
2727
if (paramsOnly) ref = '(' + paramsOnly[1] + ')';
2828

29-
parsed = ref.replace(/\n/g, " ").match(/^\s*([^(]*?)\s*(\((.*)\))?\s*$/);
29+
parsed = ref.replace(/\n/g, ' ').match(/^\s*([^(]*?)\s*(\((.*)\))?\s*$/);
3030
if (!parsed || parsed.length !== 4) throw new Error("Invalid state ref '" + ref + "'");
3131
return { state: parsed[1] || null, paramExpr: parsed[3] || null };
3232
}
@@ -57,11 +57,11 @@ interface TypeInfo {
5757
function getTypeInfo(el: IAugmentedJQuery): TypeInfo {
5858
// SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute.
5959
const isSvg = Object.prototype.toString.call(el.prop('href')) === '[object SVGAnimatedString]';
60-
const isForm = el[0].nodeName === "FORM";
60+
const isForm = el[0].nodeName === 'FORM';
6161

6262
return {
63-
attr: isForm ? "action" : (isSvg ? 'xlink:href' : 'href'),
64-
isAnchor: el.prop("tagName").toUpperCase() === "A",
63+
attr: isForm ? 'action' : (isSvg ? 'xlink:href' : 'href'),
64+
isAnchor: el.prop('tagName').toUpperCase() === 'A',
6565
clickable: !isForm
6666
};
6767
}
@@ -93,7 +93,7 @@ function defaultOpts(el: IAugmentedJQuery, $state: StateService) {
9393
return {
9494
relative: stateContext(el) || $state.$current,
9595
inherit: true,
96-
source: "sref"
96+
source: 'sref'
9797
};
9898
}
9999

@@ -524,7 +524,7 @@ let uiSrefActiveDirective: ng1_directive;
524524
uiSrefActiveDirective = ['$state', '$stateParams', '$interpolate', '$uiRouter',
525525
function $StateRefActiveDirective($state: StateService, $stateParams: Obj, $interpolate: IInterpolateService, $uiRouter: UIRouter) {
526526
return {
527-
restrict: "A",
527+
restrict: 'A',
528528
controller: ['$scope', '$element', '$attrs',
529529
function ($scope: IScope, $element: IAugmentedJQuery, $attrs: any) {
530530
const states: StateData[] = [];

src/directives/viewDirective.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
* @ng1api
33
* @module directives
44
*/ /** for typedoc */
5-
import { ng as angular } from "../angular";
6-
import { IInterpolateService, IScope, ITranscludeFunction, IAugmentedJQuery, ITimeoutService } from "angular";
5+
import { ng as angular } from '../angular';
6+
import { IInterpolateService, IScope, ITranscludeFunction, IAugmentedJQuery, ITimeoutService } from 'angular';
77

88
import {
99
extend, unnestR, filter, tail, isDefined, isFunction, isString, trace, parse,
1010
ActiveUIView, TransitionService, ResolveContext, Transition, PathNode, StateDeclaration,
1111
Param, kebobString, HookRegOptions, ViewService, $QLike, Obj, TypedMap, noop,
12-
} from "@uirouter/core";
13-
import { Ng1ViewConfig } from "../statebuilders/views";
14-
import { Ng1Controller, Ng1StateDeclaration } from "../interface";
15-
import { getLocals } from "../services";
16-
import { ng1_directive } from "./stateDirectives";
12+
} from '@uirouter/core';
13+
import { Ng1ViewConfig } from '../statebuilders/views';
14+
import { Ng1Controller, Ng1StateDeclaration } from '../interface';
15+
import { getLocals } from '../services';
16+
import { ng1_directive } from './stateDirectives';
1717

1818
/** @hidden */
1919
export type UIViewData = {
@@ -210,7 +210,7 @@ function $ViewDirective($view: ViewService, $animate: any, $uiViewScroll: any, $
210210
$type: 'ng1',
211211
id: directive.count++, // Global sequential ID for ui-view tags added to DOM
212212
name: name, // ui-view name (<div ui-view="name"></div>
213-
fqn: inherited.$uiView.fqn ? inherited.$uiView.fqn + "." + name : name, // fully qualified name, describes ___location in DOM
213+
fqn: inherited.$uiView.fqn ? inherited.$uiView.fqn + '.' + name : name, // fully qualified name, describes ___location in DOM
214214
config: null, // The ViewConfig loaded (from a state.views definition)
215215
configUpdated: configUpdatedCallback, // Called when the matching ViewConfig changes
216216
get creationContext() { // The context in which this ui-view "tag" was created
@@ -222,7 +222,7 @@ function $ViewDirective($view: ViewService, $animate: any, $uiViewScroll: any, $
222222
}
223223
};
224224

225-
trace.traceUIViewEvent("Linking", activeUIView);
225+
trace.traceUIViewEvent('Linking', activeUIView);
226226

227227
function configUpdatedCallback(config?: Ng1ViewConfig) {
228228
if (config && !(config instanceof Ng1ViewConfig)) return;
@@ -238,27 +238,27 @@ function $ViewDirective($view: ViewService, $animate: any, $uiViewScroll: any, $
238238
updateView();
239239

240240
unregister = $view.registerUIView(activeUIView);
241-
scope.$on("$destroy", function() {
242-
trace.traceUIViewEvent("Destroying/Unregistering", activeUIView);
241+
scope.$on('$destroy', function() {
242+
trace.traceUIViewEvent('Destroying/Unregistering', activeUIView);
243243
unregister();
244244
});
245245

246246
function cleanupLastView() {
247247
if (previousEl) {
248-
trace.traceUIViewEvent("Removing (previous) el", previousEl.data('$uiView'));
248+
trace.traceUIViewEvent('Removing (previous) el', previousEl.data('$uiView'));
249249
previousEl.remove();
250250
previousEl = null;
251251
}
252252

253253
if (currentScope) {
254-
trace.traceUIViewEvent("Destroying scope", activeUIView);
254+
trace.traceUIViewEvent('Destroying scope', activeUIView);
255255
currentScope.$destroy();
256256
currentScope = null;
257257
}
258258

259259
if (currentEl) {
260260
const _viewData = currentEl.data('$uiViewAnim');
261-
trace.traceUIViewEvent("Animate out", _viewData);
261+
trace.traceUIViewEvent('Animate out', _viewData);
262262
renderer.leave(currentEl, function() {
263263
_viewData.$$animLeave.resolve();
264264
previousEl = null;
@@ -396,7 +396,7 @@ function $ViewDirectiveFill($compile: angular.ICompileService,
396396
if (isString(cfg.viewDecl.component)) {
397397
const cmp = cfg.viewDecl.component;
398398
const kebobName = kebobString(cmp);
399-
const tagRegexp = new RegExp(`^(x-|data-)?${kebobName}$`, "i");
399+
const tagRegexp = new RegExp(`^(x-|data-)?${kebobName}$`, 'i');
400400

401401
const getComponentController = () => {
402402
const directiveEl = [].slice.call($element[0].children)
@@ -448,8 +448,8 @@ function registerControllerCallbacks($q: angular.IQService,
448448
// Exit early if the $transition$ will exit the state the view is for.
449449
if ($transition$ === viewCreationTrans || $transition$.exiting().indexOf(viewState as StateDeclaration) !== -1) return;
450450

451-
const toParams = $transition$.params("to") as TypedMap<any>;
452-
const fromParams = $transition$.params<TypedMap<any>>("from") as TypedMap<any>;
451+
const toParams = $transition$.params('to') as TypedMap<any>;
452+
const fromParams = $transition$.params<TypedMap<any>>('from') as TypedMap<any>;
453453
const toSchema: Param[] = $transition$.treeChanges().to.map((node: PathNode) => node.paramSchema).reduce(unnestR, []);
454454
const fromSchema: Param[] = $transition$.treeChanges().from.map((node: PathNode) => node.paramSchema).reduce(unnestR, []);
455455

src/index.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33
* @module ng1
44
*/ /** */
55

6-
export * from "./interface";
7-
export * from "./services";
8-
export * from "./statebuilders/views";
9-
export * from "./stateProvider";
10-
export * from "./urlRouterProvider";
6+
export * from './interface';
7+
export * from './services';
8+
export * from './statebuilders/views';
9+
export * from './stateProvider';
10+
export * from './urlRouterProvider';
1111

12-
import "./injectables";
13-
import "./directives/stateDirectives";
14-
import "./stateFilters";
15-
import "./directives/viewDirective";
16-
import "./viewScroll";
12+
import './injectables';
13+
import './directives/stateDirectives';
14+
import './stateFilters';
15+
import './directives/viewDirective';
16+
import './viewScroll';
1717

18-
export default "ui.router";
18+
export default 'ui.router';
1919

20-
import * as core from "@uirouter/core";
20+
import * as core from '@uirouter/core';
2121
export { core };
22-
export * from "@uirouter/core";
22+
export * from '@uirouter/core';
2323

src/injectables.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@
5151
* @module injectables
5252
*/ /** */
5353
/* tslint:disable:prefer-const */
54-
import { StateProvider } from "./stateProvider";
54+
import { StateProvider } from './stateProvider';
5555
import {
5656
StateService, TransitionService, Transition, UrlRouter, UrlMatcherFactory,
5757
StateParams, StateRegistry, UIRouterGlobals, UIRouter, Trace, UrlService
58-
} from "@uirouter/core";
59-
import { UIViewScrollProvider } from "./viewScroll";
60-
import { UrlRouterProvider } from "./urlRouterProvider";
58+
} from '@uirouter/core';
59+
import { UIViewScrollProvider } from './viewScroll';
60+
import { UrlRouterProvider } from './urlRouterProvider';
6161

6262
/**
6363
* The current (or pending) State Parameters

src/interface.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @ng1api
33
* @module ng1
44
*/ /** */
5-
import { StateDeclaration, _ViewDeclaration, IInjectable, Transition, HookResult } from "@uirouter/core";
5+
import { StateDeclaration, _ViewDeclaration, IInjectable, Transition, HookResult } from '@uirouter/core';
66

77

88
/**
@@ -742,7 +742,7 @@ export interface TemplateFactoryProvider {
742742
useHttpService(useUnsafeHttpService: boolean);
743743
}
744744

745-
declare module "@uirouter/core/lib/state/stateRegistry" {
745+
declare module '@uirouter/core/lib/state/stateRegistry' {
746746
interface StateRegistry {
747747
register(state: Ng1StateDeclaration);
748748
}

src/legacy/resolveService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @module ng1 */ /** */
2-
import { StateObject, PathNode, ResolveContext, Obj, mapObj, resolvablesBuilder } from "@uirouter/core";
3-
import * as angular from "angular";
2+
import { StateObject, PathNode, ResolveContext, Obj, mapObj, resolvablesBuilder } from '@uirouter/core';
3+
import * as angular from 'angular';
44

55
/**
66
* Implementation of the legacy `$resolve` service for angular 1.

src/legacy/stateEvents.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
*
1919
* @module ng1_state_events
2020
*/ /** */
21-
import { ng as angular } from "../angular";
22-
import { IScope, IAngularEvent, IServiceProviderFactory } from "angular";
21+
import { ng as angular } from '../angular';
22+
import { IScope, IAngularEvent, IServiceProviderFactory } from 'angular';
2323
import {
2424
Obj, TargetState, StateService, Transition, TransitionService, UrlRouter, HookResult, UIInjector
25-
} from "@uirouter/core";
26-
import { StateProvider } from "../stateProvider";
25+
} from '@uirouter/core';
26+
import { StateProvider } from '../stateProvider';
2727

2828
/**
2929
* An event broadcast on `$rootScope` when the state transition **begins**.
@@ -159,7 +159,7 @@ export let $stateNotFound: IAngularEvent;
159159
function applyPairs(memo: Obj, keyValTuple: any[]) {
160160
let key: string, value: any;
161161
if (Array.isArray(keyValTuple)) [key, value] = keyValTuple;
162-
if (!isString(key)) throw new Error("invalid parameters to applyPairs");
162+
if (!isString(key)) throw new Error('invalid parameters to applyPairs');
163163
memo[key] = value;
164164
return memo;
165165
}
@@ -177,8 +177,8 @@ export let $stateNotFound: IAngularEvent;
177177
const enabledEvents = $stateEvents.provider.enabled();
178178

179179

180-
const toParams = $transition$.params("to");
181-
const fromParams = $transition$.params("from");
180+
const toParams = $transition$.params('to');
181+
const fromParams = $transition$.params('from');
182182

183183
if (enabledEvents.$stateChangeSuccess) {
184184
const startEvent = $rootScope.$broadcast('$stateChangeStart', $transition$.to(), toParams, $transition$.from(), fromParams, $transition$.options(), $transition$);
@@ -200,7 +200,7 @@ export let $stateNotFound: IAngularEvent;
200200
}
201201

202202
if (enabledEvents.$stateChangeError) {
203-
$transition$.promise["catch"](function (error) {
203+
$transition$.promise['catch'](function (error) {
204204
if (error && (error.type === 2 /* RejectType.SUPERSEDED */ || error.type === 3 /* RejectType.ABORTED */))
205205
return;
206206

@@ -258,7 +258,7 @@ export let $stateNotFound: IAngularEvent;
258258
const enabledStateEvents = <IEventsToggle> allEvents.map(e => [e, true]).reduce(applyPairs, {});
259259

260260
function assertNotRuntime() {
261-
if (runtime) throw new Error("Cannot enable events at runtime (use $stateEventsProvider");
261+
if (runtime) throw new Error('Cannot enable events at runtime (use $stateEventsProvider');
262262
}
263263

264264
/**
@@ -288,7 +288,7 @@ export let $stateNotFound: IAngularEvent;
288288
function $get($transitions: TransitionService) {
289289
runtime = true;
290290

291-
if (enabledStateEvents["$stateNotFound"])
291+
if (enabledStateEvents['$stateNotFound'])
292292
$stateProvider.onInvalid(stateNotFoundHandler);
293293
if (enabledStateEvents.$stateChangeStart)
294294
$transitions.onBefore({}, stateChangeStartHandler, { priority: 1000 });
@@ -301,7 +301,7 @@ export let $stateNotFound: IAngularEvent;
301301

302302

303303
angular.module('ui.router.state.events', ['ui.router.state'])
304-
.provider("$stateEvents", <IServiceProviderFactory> $StateEventsProvider)
304+
.provider('$stateEvents', <IServiceProviderFactory> $StateEventsProvider)
305305
.run(['$stateEvents', function ($stateEvents: any) { /* Invokes $get() */
306306
}]);
307307
})();

src/locationServices.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* @internalapi
33
* @module ng1
44
*/ /** */
5-
import { LocationConfig, LocationServices, UIRouter, ParamType, isDefined } from "@uirouter/core";
6-
import { val, createProxyFunctions, removeFrom, isObject } from "@uirouter/core";
7-
import { ILocationService, ILocationProvider } from "angular";
5+
import { LocationConfig, LocationServices, UIRouter, ParamType, isDefined } from '@uirouter/core';
6+
import { val, createProxyFunctions, removeFrom, isObject } from '@uirouter/core';
7+
import { ILocationService, ILocationProvider } from 'angular';
88

99
/**
1010
* Implements UI-Router LocationServices and LocationConfig using Angular 1's $___location service
@@ -80,12 +80,12 @@ export class Ng1LocationServices implements LocationConfig, LocationServices {
8080
this.$sniffer = $sniffer;
8181

8282
// Bind $locationChangeSuccess to the listeners registered in LocationService.onChange
83-
$rootScope.$on("$locationChangeSuccess", evt => this._urlListeners.forEach(fn => fn(evt)));
83+
$rootScope.$on('$locationChangeSuccess', evt => this._urlListeners.forEach(fn => fn(evt)));
8484
const _loc = val($___location);
8585
const _browser = val($browser);
8686

8787
// Bind these LocationService functions to $___location
88-
createProxyFunctions(_loc, this, _loc, ["replace", "path", "search", "hash"]);
88+
createProxyFunctions(_loc, this, _loc, ['replace', 'path', 'search', 'hash']);
8989
// Bind these LocationConfig functions to $___location
9090
createProxyFunctions(_loc, this, _loc, ['port', 'protocol', 'host']);
9191
// Bind these LocationConfig functions to $browser

0 commit comments

Comments
 (0)