Skip to content

Commit ee40290

Browse files
christopherthielenmergify[bot]
authored andcommitted
fix: use explicit angularjs annotation in the example
1 parent d7fb2d5 commit ee40290

File tree

1 file changed

+38
-34
lines changed

1 file changed

+38
-34
lines changed

example/src/main.ts

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,42 +8,46 @@ import { UrlService } from '@uirouter/core';
88

99
const app = angular.module('minimal', ['ui.router.upgrade']);
1010

11-
app.run(($stateRegistry, $urlService) => {
12-
$urlService.rules.initial({ state: 'app' });
11+
app.run([
12+
'$stateRegistry',
13+
'$urlService',
14+
($stateRegistry, $urlService) => {
15+
$urlService.rules.initial({ state: 'app' });
1316

14-
$stateRegistry.register({
15-
url: '',
16-
name: 'app',
17-
template: `
17+
$stateRegistry.register({
18+
url: '',
19+
name: 'app',
20+
template: `
1821
<a ui-sref=".ng1" ui-sref-active-eq="active">app.ng1</a>
1922
<a ui-sref=".ng1.ng2" ui-sref-active-eq="active">app.ng1.ng2</a>
2023
<a ui-sref=".ng2" ui-sref-active-eq="active">app.ng2</a>
2124
<a ui-sref=".ng2.ng2" ui-sref-active-eq="active">app.ng2.ng2</a>
2225
<ui-view></ui-view>
2326
`,
24-
});
27+
});
2528

26-
// route to ng1 component
27-
$stateRegistry.register({
28-
url: '/ng1',
29-
name: 'app.ng1',
30-
component: 'ng1Component',
31-
});
29+
// route to ng1 component
30+
$stateRegistry.register({
31+
url: '/ng1',
32+
name: 'app.ng1',
33+
component: 'ng1Component',
34+
});
3235

33-
// nested route to ng2 component
34-
$stateRegistry.register({
35-
url: '/ng2',
36-
name: 'app.ng1.ng2',
37-
component: Ng2Component,
38-
});
36+
// nested route to ng2 component
37+
$stateRegistry.register({
38+
url: '/ng2',
39+
name: 'app.ng1.ng2',
40+
component: Ng2Component,
41+
});
3942

40-
// route to ng2 component
41-
$stateRegistry.register({
42-
url: '/ng2',
43-
name: 'app.ng2',
44-
component: Ng2Component,
45-
});
46-
});
43+
// route to ng2 component
44+
$stateRegistry.register({
45+
url: '/ng2',
46+
name: 'app.ng2',
47+
component: Ng2Component,
48+
});
49+
},
50+
]);
4751

4852
// An AngularJS component
4953
app.component('ng1Component', {
@@ -52,8 +56,8 @@ app.component('ng1Component', {
5256
<a ui-sref="app">Back to app</a>
5357
<ui-view></ui-view>
5458
`,
55-
controller: function() {
56-
this.$onInit = function() {
59+
controller: function () {
60+
this.$onInit = function () {
5761
console.log('ng1Component.$onInit()');
5862
};
5963
},
@@ -63,10 +67,10 @@ app.component('ng1Component', {
6367
@Component({
6468
selector: 'ng2-component',
6569
template: `
66-
<h1>ng2 component</h1>
67-
<a uiSref="app">Back to app</a>
68-
<ui-view></ui-view>
69-
`,
70+
<h1>ng2 component</h1>
71+
<a uiSref="app">Back to app</a>
72+
<ui-view></ui-view>
73+
`,
7074
})
7175
export class Ng2Component {
7276
ngOnInit() {
@@ -102,12 +106,12 @@ export class RootModule {
102106

103107
// Using AngularJS config block, call `deferIntercept()`.
104108
// This tells UI-Router to delay the initial URL sync (until all bootstrapping is complete)
105-
app.config(['$urlServiceProvider', $urlService => $urlService.deferIntercept()]);
109+
app.config(['$urlServiceProvider', ($urlService) => $urlService.deferIntercept()]);
106110

107111
// Manually bootstrap the Angular app
108112
platformBrowserDynamic()
109113
.bootstrapModule(RootModule)
110-
.then(platformRef => {
114+
.then((platformRef) => {
111115
// get() UrlService from DI (this call will create all the UIRouter services)
112116
const url: UrlService = platformRef.injector.get(UrlService);
113117

0 commit comments

Comments
 (0)