Skip to content

Commit d2e28cf

Browse files
BC-BREAK: renamed all UIRouter* symbols to UiRouter* for more consistent naming.
Previously -> Now `UIRouter` -> `UiRouter` `UIRouterConfig` -> `UiRouterConfig` `UIRouterGlobals` -> `UiRouterGlobals` ... etc. Closes #2828
1 parent 7c9d1a1 commit d2e28cf

22 files changed

+97
-97
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"test:ng13": "karma start config/karma.ng13.js",
1818
"test:ng14": "karma start config/karma.ng14.js",
1919
"test:ng15": "karma start config/karma.ng15.js",
20-
"test:integrate": "npm run test:core && npm run test:ng12 && npm run test:ng13 && npm run test:ng14 && npm run test:ng15"
20+
"test:integrate": "tsc && npm run test:core && npm run test:ng12 && npm run test:ng13 && npm run test:ng14 && npm run test:ng15"
2121
},
2222
"homepage": "http://angular-ui.github.com/ui-router",
2323
"contributors": [

src/common/trace.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import {parse} from "../common/hof";
3333
import {isNumber} from "../common/predicates";
3434
import {Transition} from "../transition/transition";
35-
import {ActiveUIView, ViewConfig} from "../view/interface";
35+
import {ActiveUiView, ViewConfig} from "../view/interface";
3636
import {stringify, functionToString, maxLength, padString} from "./strings";
3737
import {Resolvable} from "../resolve/resolvable";
3838
import {PathNode} from "../path/node";
@@ -211,25 +211,25 @@ export class Trace {
211211
}
212212

213213
/** called by ui-router code */
214-
traceUiViewEvent(event: string, viewData: ActiveUIView, extra = "") {
214+
traceUiViewEvent(event: string, viewData: ActiveUiView, extra = "") {
215215
if (!this.enabled(Category.UIVIEW)) return;
216216
console.log(`ui-view: ${padString(30, event)} ${uiViewString(viewData)}${extra}`);
217217
}
218218

219219
/** called by ui-router code */
220-
traceUiViewConfigUpdated(viewData: ActiveUIView, context) {
220+
traceUiViewConfigUpdated(viewData: ActiveUiView, context) {
221221
if (!this.enabled(Category.UIVIEW)) return;
222222
this.traceUiViewEvent("Updating", viewData, ` with ViewConfig from context='${context}'`);
223223
}
224224

225225
/** called by ui-router code */
226-
traceUiViewScopeCreated(viewData: ActiveUIView, newScope) {
226+
traceUiViewScopeCreated(viewData: ActiveUiView, newScope) {
227227
if (!this.enabled(Category.UIVIEW)) return;
228228
this.traceUiViewEvent("Created scope for", viewData, `, scope #${newScope.$id}`);
229229
}
230230

231231
/** called by ui-router code */
232-
traceUiViewFill(viewData: ActiveUIView, html) {
232+
traceUiViewFill(viewData: ActiveUiView, html) {
233233
if (!this.enabled(Category.UIVIEW)) return;
234234
this.traceUiViewEvent("Fill", viewData, ` with: ${maxLength(200, html)}`);
235235
}
@@ -241,7 +241,7 @@ export class Trace {
241241
}
242242

243243
/** called by ui-router code */
244-
traceViewServiceUiViewEvent(event: string, viewData: ActiveUIView) {
244+
traceViewServiceUiViewEvent(event: string, viewData: ActiveUiView) {
245245
if (!this.enabled(Category.VIEWCONFIG)) return;
246246
console.log(`VIEWCONFIG: ${event} ${uiViewString(viewData)}`);
247247
}

src/core.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ export * from "./url/module";
1010
export * from "./view/module";
1111
export * from "./globals";
1212

13-
export { UIRouter } from "./router";
13+
export { UiRouter } from "./router";

src/globals.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {Observable} from "rxjs/Rx";
1414
* This is where we hold the global mutable state such as current state, current
1515
* params, current transition, etc.
1616
*/
17-
export interface UIRouterGlobals {
17+
export interface UiRouterGlobals {
1818
/**
1919
* Current parameter values
2020
*
@@ -43,7 +43,7 @@ export interface UIRouterGlobals {
4343
/**
4444
* Global mutable state
4545
*/
46-
export class Globals implements UIRouterGlobals {
46+
export class Globals implements UiRouterGlobals {
4747
params: StateParams = new StateParams();
4848
current: StateDeclaration;
4949
$current: State;

src/ng1/directives/stateDirectives.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/ /** for typedoc */
88
import {extend, forEach, toJson, tail} from "../../common/common";
99
import {isString, isObject} from "../../common/predicates";
10-
import {UIViewData} from "./viewDirective";
10+
import {UiViewData} from "./viewDirective";
1111
import {parse} from "../../common/hof";
1212
import {PathNode} from "../../path/node";
1313

@@ -22,7 +22,7 @@ function parseStateRef(ref, current) {
2222

2323
/** @hidden */
2424
function stateContext(el) {
25-
let $uiView: UIViewData = el.parent().inheritedData('$uiView');
25+
let $uiView: UiViewData = el.parent().inheritedData('$uiView');
2626
let path: PathNode[] = parse('$cfg.path')($uiView);
2727
return path ? tail(path).state.name : undefined;
2828
}

src/ng1/directives/viewDirective.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import {extend, unnestR, filter, tail} from "../../common/common";
44
import {isDefined, isFunction, isString} from "../../common/predicates";
55
import {trace} from "../../common/trace";
6-
import {ActiveUIView} from "../../view/interface";
6+
import {ActiveUiView} from "../../view/interface";
77
import {Ng1ViewConfig} from "../statebuilders/views";
88
import {TransitionService} from "../../transition/transitionService";
99
import {parse} from "../../common/hof";
@@ -17,9 +17,9 @@ import {Ng1Controller, Ng1StateDeclaration} from "../interface";
1717
import {getLocals} from "../services";
1818

1919
/** @hidden */
20-
export type UIViewData = {
20+
export type UiViewData = {
2121
$cfg: Ng1ViewConfig;
22-
$uiView: ActiveUIView;
22+
$uiView: ActiveUiView;
2323

2424
$animEnter: Promise<any>;
2525
$animLeave: Promise<any>;
@@ -203,7 +203,7 @@ function $ViewDirective( $view, $animate, $uiViewScroll, $interpolate,
203203
inherited = $element.inheritedData('$uiView') || rootData,
204204
name = $interpolate(attrs.uiView || attrs.name || '')(scope) || '$default';
205205

206-
let activeUIView: ActiveUIView = {
206+
let activeUiView: ActiveUiView = {
207207
$type: 'ng1',
208208
id: directive.count++, // Global sequential ID for ui-view tags added to DOM
209209
name: name, // ui-view name (<div ui-view="name"></div>
@@ -215,24 +215,24 @@ function $ViewDirective( $view, $animate, $uiViewScroll, $interpolate,
215215
}
216216
};
217217

218-
trace.traceUiViewEvent("Linking", activeUIView);
218+
trace.traceUiViewEvent("Linking", activeUiView);
219219

220220
function configUpdatedCallback(config?: Ng1ViewConfig) {
221221
if (config && !(config instanceof Ng1ViewConfig)) return;
222222
if (configsEqual(viewConfig, config)) return;
223-
trace.traceUiViewConfigUpdated(activeUIView, config && config.viewDecl && config.viewDecl.$context);
223+
trace.traceUiViewConfigUpdated(activeUiView, config && config.viewDecl && config.viewDecl.$context);
224224

225225
viewConfig = config;
226226
updateView(config);
227227
}
228228

229-
$element.data('$uiView', { $uiView: activeUIView });
229+
$element.data('$uiView', { $uiView: activeUiView });
230230

231231
updateView();
232232

233-
unregister = $view.registerUiView(activeUIView);
233+
unregister = $view.registerUiView(activeUiView);
234234
scope.$on("$destroy", function() {
235-
trace.traceUiViewEvent("Destroying/Unregistering", activeUIView);
235+
trace.traceUiViewEvent("Destroying/Unregistering", activeUiView);
236236
unregister();
237237
});
238238

@@ -244,7 +244,7 @@ function $ViewDirective( $view, $animate, $uiViewScroll, $interpolate,
244244
}
245245

246246
if (currentScope) {
247-
trace.traceUiViewEvent("Destroying scope", activeUIView);
247+
trace.traceUiViewEvent("Destroying scope", activeUiView);
248248
currentScope.$destroy();
249249
currentScope = null;
250250
}
@@ -264,12 +264,12 @@ function $ViewDirective( $view, $animate, $uiViewScroll, $interpolate,
264264

265265
function updateView(config?: Ng1ViewConfig) {
266266
let newScope = scope.$new();
267-
trace.traceUiViewScopeCreated(activeUIView, newScope);
267+
trace.traceUiViewScopeCreated(activeUiView, newScope);
268268
let animEnter = $q.defer(), animLeave = $q.defer();
269269

270-
let $uiViewData: UIViewData = {
270+
let $uiViewData: UiViewData = {
271271
$cfg: config,
272-
$uiView: activeUIView,
272+
$uiView: activeUiView,
273273
$animEnter: animEnter.promise,
274274
$animLeave: animLeave.promise,
275275
$$animLeave: animLeave
@@ -323,7 +323,7 @@ function $ViewDirectiveFill ( $compile, $controller, $transitions, $view,
323323
let initial = tElement.html();
324324

325325
return function (scope, $element) {
326-
let data: UIViewData = $element.data('$uiView');
326+
let data: UiViewData = $element.data('$uiView');
327327
if (!data) return;
328328

329329
let cfg: Ng1ViewConfig = data.$cfg || <any> { viewDecl: {} };

src/ng1/services.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
*
44
* - Provides an implementation for the [[CoreServices]] API, based on angular 1 services.
55
* - Also registers some services with the angular 1 injector.
6-
* - Creates and bootstraps a new [[UIRouter]] object. Ties it to the the angular 1 lifecycle.
6+
* - Creates and bootstraps a new [[UiRouter]] object. Ties it to the the angular 1 lifecycle.
77
*
88
* @module ng1
99
* @preferred
1010
*/
1111

1212
/** for typedoc */
13-
import {UIRouter} from "../router";
13+
import {UiRouter} from "../router";
1414
import {services} from "../common/coreservices";
1515
import {bindFunctions, removeFrom, applyPairs} from "../common/common";
1616
import {prop, propEq} from "../common/hof";
@@ -157,14 +157,14 @@ function runBlock($injector, $q) {
157157

158158
app.run(runBlock);
159159

160-
let router: UIRouter = null;
160+
let router: UiRouter = null;
161161

162-
ng1UIRouter.$inject = ['$locationProvider'];
162+
ng1UiRouter.$inject = ['$locationProvider'];
163163
/** This angular 1 provider instantiates a Router and exposes its services via the angular injector */
164-
function ng1UIRouter($locationProvider) {
164+
function ng1UiRouter($locationProvider) {
165165

166-
// Create a new instance of the Router when the ng1UIRouterProvider is initialized
167-
router = new UIRouter();
166+
// Create a new instance of the Router when the ng1UiRouterProvider is initialized
167+
router = new UiRouter();
168168

169169
// Apply ng1 specific StateBuilder code for `views`, `resolve`, and `onExit/Retain/Enter` properties
170170
router.stateRegistry.decorator("views", ng1ViewsBuilder);
@@ -212,17 +212,17 @@ function ng1UIRouter($locationProvider) {
212212
}
213213
}
214214

215-
function $stateParamsFactory(ng1UIRouter) {
216-
return ng1UIRouter.globals.params;
215+
function $stateParamsFactory(ng1UiRouter) {
216+
return ng1UiRouter.globals.params;
217217
}
218218

219219
// The 'ui.router' ng1 module depends on 'ui.router.init' module.
220-
angular.module('ui.router.init', []).provider("ng1UIRouter", <any> ng1UIRouter);
220+
angular.module('ui.router.init', []).provider("ng1UiRouter", <any> ng1UiRouter);
221221
// This effectively calls $get() to init when we enter runtime
222-
angular.module('ui.router.init').run(['ng1UIRouter', function(ng1UIRouter) { }]);
222+
angular.module('ui.router.init').run(['ng1UiRouter', function(ng1UiRouter) { }]);
223223

224224
// $urlMatcherFactory service and $urlMatcherFactoryProvider
225-
angular.module('ui.router.util').provider('$urlMatcherFactory', ['ng1UIRouterProvider', () => router.urlMatcherFactory]);
225+
angular.module('ui.router.util').provider('$urlMatcherFactory', ['ng1UiRouterProvider', () => router.urlMatcherFactory]);
226226
angular.module('ui.router.util').run(['$urlMatcherFactory', function($urlMatcherFactory) { }]);
227227

228228
// $urlRouter service and $urlRouterProvider
@@ -234,7 +234,7 @@ function getUrlRouterProvider() {
234234
};
235235
return router.urlRouterProvider;
236236
}
237-
angular.module('ui.router.router').provider('$urlRouter', ['ng1UIRouterProvider', getUrlRouterProvider]);
237+
angular.module('ui.router.router').provider('$urlRouter', ['ng1UiRouterProvider', getUrlRouterProvider]);
238238
angular.module('ui.router.router').run(['$urlRouter', function($urlRouter) { }]);
239239

240240
// $state service and $stateProvider
@@ -247,22 +247,22 @@ function getStateProvider() {
247247
};
248248
return router.stateProvider;
249249
}
250-
angular.module('ui.router.state').provider('$state', ['ng1UIRouterProvider', getStateProvider]);
250+
angular.module('ui.router.state').provider('$state', ['ng1UiRouterProvider', getStateProvider]);
251251
angular.module('ui.router.state').run(['$state', function($state) { }]);
252252

253253
// $stateParams service
254-
angular.module('ui.router.state').factory('$stateParams', ['ng1UIRouter', (ng1UIRouter) =>
255-
ng1UIRouter.globals.params]);
254+
angular.module('ui.router.state').factory('$stateParams', ['ng1UiRouter', (ng1UiRouter) =>
255+
ng1UiRouter.globals.params]);
256256

257257
// $transitions service and $transitionsProvider
258258
function getTransitionsProvider() {
259259
router.transitionService["$get"] = () => router.transitionService;
260260
return router.transitionService;
261261
}
262-
angular.module('ui.router.state').provider('$transitions', ['ng1UIRouterProvider', getTransitionsProvider]);
262+
angular.module('ui.router.state').provider('$transitions', ['ng1UiRouterProvider', getTransitionsProvider]);
263263

264264
// $templateFactory service
265-
angular.module('ui.router.util').factory('$templateFactory', ['ng1UIRouter', () => new TemplateFactory()]);
265+
angular.module('ui.router.util').factory('$templateFactory', ['ng1UiRouter', () => new TemplateFactory()]);
266266

267267
// The $view service
268268
angular.module('ui.router').factory('$view', () => router.viewService);

src/ng2/directives/uiSref.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @module ng2_directives */ /** */
2-
import {UIRouter} from "../../router";
2+
import {UiRouter} from "../../router";
33
import {Directive, Inject, Input} from "@angular/core";
44
import {Optional} from "@angular/core";
55
import {ElementRef} from "@angular/core";
@@ -67,7 +67,7 @@ export class UiSref {
6767
@Input('uiOptions') options: any;
6868

6969
constructor(
70-
private _router: UIRouter,
70+
private _router: UiRouter,
7171
@Inject(UiView.PARENT_INJECT) public parent: ParentUiViewInject,
7272
@Optional() private _anchorUiSref: AnchorUiSref
7373
) { }

src/ng2/directives/uiSrefStatus.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {TargetState} from "../../state/targetState";
99
import {TreeChanges} from "../../transition/interface";
1010
import {State} from "../../state/stateObject";
1111
import {anyTrueR, tail, unnestR} from "../../common/common";
12-
import {UIRouterGlobals, Globals} from "../../globals";
12+
import {UiRouterGlobals, Globals} from "../../globals";
1313
import {Param} from "../../params/param";
1414
import {PathFactory} from "../../path/pathFactory";
1515

src/ng2/directives/uiView.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {Input} from "@angular/core";
88
import {ComponentRef} from "@angular/core";
99
import {Type} from "@angular/core";
1010

11-
import {UIRouter} from "../../router";
11+
import {UiRouter} from "../../router";
1212
import {trace} from "../../common/trace";
1313
import {Inject} from "@angular/core";
1414
import {ViewContext, ViewConfig} from "../../view/interface";
@@ -131,7 +131,7 @@ export class UiView {
131131
static PARENT_INJECT = "UiView.PARENT_INJECT";
132132

133133
constructor(
134-
public router: UIRouter,
134+
public router: UiRouter,
135135
@Inject(UiView.PARENT_INJECT) public parent: ParentUiViewInject,
136136
public compResolver: ComponentResolver,
137137
public viewContainerRef: ViewContainerRef

0 commit comments

Comments
 (0)