main.component.ts
870 Bytes
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
37
38
39
40
41
42
43
44
import {Component, StateConfig} from 'ng-forward';
import {Profile} from '../profile/profile.component';
@Component({
selector: 'main-content',
templateUrl: "app/main/main.html",
})
export class MainContent {
constructor() {
console.log("MAIN");
}
}
@Component({
selector: 'main',
template: '<div ng-view></div>'
})
@StateConfig([
{
url: '/',
component: MainContent,
name: 'main',
resolve: {
currentUser: function(AuthService) {
return AuthService.loginFromCookie();
}
}
},
{
url: "^/:profile",
// abstract: true,
component: Profile,
name: 'main.profile',
views: {
"content": {
templateUrl: "app/profile/profile.html",
}
}
}
])
export class Main {
}