1
|
import {Component, Directive, ElementRef, Renderer} from '@angular/core';
|
2
|
import {RouterConfig, ROUTER_DIRECTIVES } from '@angular/router';
|
3
|
import {Http} from '@angular/http';
|
4
|
// import {SearchComponent} from './searchPages/search.component';
|
5
|
// import {ClaimComponent} from './claimPages/claim/claim.component';
|
6
|
import {ClaimsAdminComponent} from './claimPages/claims/claimsAdmin.component';
|
7
|
import {HomeComponent} from './home/home.component';
|
8
|
// import {LinkingComponent} from './claimPages/linking/linking.component';
|
9
|
// import {LinkingHomeComponent} from './claimPages/linking/linkingHome.component';
|
10
|
// import {MyClaimsComponent} from './claimPages/myClaims/myClaims.component';
|
11
|
// import {ProjectComponent} from './landingPages/project/project.component';
|
12
|
// import {DatasetComponent} from './landingPages/dataset/dataset.component';
|
13
|
// import {PersonComponent} from './landingPages/person/person.component';
|
14
|
// import {PublicationComponent} from './landingPages/publication/publication.component';
|
15
|
// import {OrganizationComponent} from './landingPages/organization/organization.component';
|
16
|
// import {MyClaimsDemoComponent} from './claimPages/myClaimsDemo.component';
|
17
|
// import {SearchPublicationsComponent} from './searchPages/searchPublications.component';
|
18
|
// import {AdvancedSearchPublicationsComponent} from './searchPages/advancedSearchPublications.component';
|
19
|
// import {UploadComponent} from './upload.component';
|
20
|
// import {BulkLinkingComponent} from './claimPages/linking/bulkLinking.component';
|
21
|
// import {DepositComponent} from './deposit/deposit.component';
|
22
|
import 'rxjs/Rx';
|
23
|
|
24
|
|
25
|
|
26
|
@Component({
|
27
|
selector: 'app',
|
28
|
directives: [
|
29
|
...ROUTER_DIRECTIVES
|
30
|
],
|
31
|
precompile: [ ClaimsAdminComponent, HomeComponent],
|
32
|
styles: [`
|
33
|
.router-link-active {
|
34
|
background-color: lightgray;
|
35
|
}
|
36
|
`],
|
37
|
template: `
|
38
|
<div>
|
39
|
<nav class="navbar navbar-default" id="top">
|
40
|
<div class="container-fluid">
|
41
|
<!-- Brand and toggle get grouped for better mobile display -->
|
42
|
<div class="navbar-header">
|
43
|
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
|
44
|
<span class="sr-only">Toggle navigation</span>
|
45
|
<span class="icon-bar"></span>
|
46
|
<span class="icon-bar"></span>
|
47
|
<span class="icon-bar"></span>
|
48
|
</button>
|
49
|
<a class="navbar-brand" href="#">OpenAire</a>
|
50
|
</div>
|
51
|
|
52
|
<!-- Collect the nav links, forms, and other content for toggling -->
|
53
|
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
54
|
<ul class="nav navbar-nav">
|
55
|
<li><a [routerLinkActive]="['active', 'router-link-active']" [routerLink]=" ['./claims'] ">Claims Admin</a></li>
|
56
|
|
57
|
</ul>
|
58
|
|
59
|
</div><!-- /.navbar-collapse -->
|
60
|
</div><!-- /.container-fluid -->
|
61
|
</nav>
|
62
|
|
63
|
<main>
|
64
|
<router-outlet></router-outlet>
|
65
|
</main>
|
66
|
|
67
|
</div>
|
68
|
`
|
69
|
})
|
70
|
|
71
|
|
72
|
|
73
|
|
74
|
export class App {
|
75
|
name: string = 'Angular 2';
|
76
|
data = {};
|
77
|
server;
|
78
|
|
79
|
constructor(public http: Http ) {
|
80
|
|
81
|
}
|
82
|
|
83
|
|
84
|
ngOnInit() {
|
85
|
setTimeout(() => {
|
86
|
this.server = 'Rendered on the Server';
|
87
|
}, 10);
|
88
|
|
89
|
}
|
90
|
|
91
|
}
|
92
|
|
93
|
export const routes: RouterConfig = [
|
94
|
{ path: '',
|
95
|
pathMatch: 'full',
|
96
|
redirectTo: 'home' },
|
97
|
{ path: 'home', component: HomeComponent },
|
98
|
{ path: 'claims', component: ClaimsAdminComponent } ];
|
99
|
// ,
|
100
|
// { path: 'claim', component: ClaimComponent },
|
101
|
// { path: 'search', component: SearchComponent },
|
102
|
// { path: 'linking', component: LinkingComponent },
|
103
|
// { path: 'my-claims', component: MyClaimsComponent },
|
104
|
// { path: 'demo', component: MyClaimsDemoComponent },
|
105
|
// { path: 'project', component: ProjectComponent},
|
106
|
// { path: 'publication', component: PublicationComponent },
|
107
|
// { path: 'dataset', component: DatasetComponent},
|
108
|
// { path: 'person', component: PersonComponent },
|
109
|
// { path: 'organization', component: OrganizationComponent },
|
110
|
// { path: 'up', component: UploadComponent},
|
111
|
// { path: 'bulk-linking', component: BulkLinkingComponent},
|
112
|
// { path: 'search-publications', component: SearchPublicationsComponent },
|
113
|
// { path: 'advanced-search-publications', component: AdvancedSearchPublicationsComponent },
|
114
|
// { path: 'deposit', component: DepositComponent}
|
115
|
//
|
116
|
// ];
|