/
component.angularjs.ts
36 lines (34 loc) · 1.24 KB
/
component.angularjs.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { ANGULARJS_MODULE } from '../../angularjs.module';
import { RouterService } from '../../services/router/service';
import { AppController } from './controller';
ANGULARJS_MODULE.component('app', {
controller: [
'$scope',
class extends AppController {
public resolvedRoute: any = {
url: 'series',
};
public constructor($scope: any) {
super();
RouterService.subscribe((route: any, params: any, query: any) => {
this.resolvedRoute = {
params,
query,
url: route.url,
};
$scope.$apply();
});
}
},
],
template: `
<div id="app">
<h4>{{ $ctrl.framework.name }} v{{ $ctrl.framework.version }}</h4>
<small>{{ $ctrl.finishedRendering }} ms upcomming time</small>
<list-serie ng-if="$ctrl.resolvedRoute.url === 'series'"></list-serie>
<create-serie ng-if="$ctrl.resolvedRoute.url === 'series/create'"></create-serie>
<edit-serie ng-if="$ctrl.resolvedRoute.url === 'series/:id/edit'" resolved-route="$ctrl.resolvedRoute" test="$ctrl.resolvedRoute"></edit-serie>
<small>Used filters: {{ $ctrl.filters.date($ctrl.dummies.date) }} | {{ $ctrl.filters.currency($ctrl.dummies.price) }} €</small>
</div>
`,
});