117 lines
4.1 KiB
TypeScript
117 lines
4.1 KiB
TypeScript
import {Component, Directive, ElementRef, Renderer} from '@angular/core';
|
|
import {RouterConfig, ROUTER_DIRECTIVES } from '@angular/router';
|
|
import {Http} from '@angular/http';
|
|
// import {SearchComponent} from './searchPages/search.component';
|
|
// import {ClaimComponent} from './claimPages/claim/claim.component';
|
|
import {ClaimsAdminComponent} from './claimPages/claims/claimsAdmin.component';
|
|
import {HomeComponent} from './home/home.component';
|
|
// import {LinkingComponent} from './claimPages/linking/linking.component';
|
|
// import {LinkingHomeComponent} from './claimPages/linking/linkingHome.component';
|
|
// import {MyClaimsComponent} from './claimPages/myClaims/myClaims.component';
|
|
// import {ProjectComponent} from './landingPages/project/project.component';
|
|
// import {DatasetComponent} from './landingPages/dataset/dataset.component';
|
|
// import {PersonComponent} from './landingPages/person/person.component';
|
|
// import {PublicationComponent} from './landingPages/publication/publication.component';
|
|
// import {OrganizationComponent} from './landingPages/organization/organization.component';
|
|
// import {MyClaimsDemoComponent} from './claimPages/myClaimsDemo.component';
|
|
// import {SearchPublicationsComponent} from './searchPages/searchPublications.component';
|
|
// import {AdvancedSearchPublicationsComponent} from './searchPages/advancedSearchPublications.component';
|
|
// import {UploadComponent} from './upload.component';
|
|
// import {BulkLinkingComponent} from './claimPages/linking/bulkLinking.component';
|
|
// import {DepositComponent} from './deposit/deposit.component';
|
|
import 'rxjs/Rx';
|
|
|
|
|
|
|
|
@Component({
|
|
selector: 'app',
|
|
directives: [
|
|
...ROUTER_DIRECTIVES
|
|
],
|
|
precompile: [ ClaimsAdminComponent, HomeComponent],
|
|
styles: [`
|
|
.router-link-active {
|
|
background-color: lightgray;
|
|
}
|
|
`],
|
|
template: `
|
|
<div>
|
|
<nav class="navbar navbar-default" id="top">
|
|
<div class="container-fluid">
|
|
<!-- Brand and toggle get grouped for better mobile display -->
|
|
<div class="navbar-header">
|
|
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
|
|
<span class="sr-only">Toggle navigation</span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
</button>
|
|
<a class="navbar-brand" href="#">OpenAire</a>
|
|
</div>
|
|
|
|
<!-- Collect the nav links, forms, and other content for toggling -->
|
|
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
|
<ul class="nav navbar-nav">
|
|
<li><a [routerLinkActive]="['active', 'router-link-active']" [routerLink]=" ['./claims'] ">Claims Admin</a></li>
|
|
|
|
</ul>
|
|
|
|
</div><!-- /.navbar-collapse -->
|
|
</div><!-- /.container-fluid -->
|
|
</nav>
|
|
|
|
<main>
|
|
<router-outlet></router-outlet>
|
|
</main>
|
|
|
|
</div>
|
|
`
|
|
})
|
|
|
|
|
|
|
|
|
|
export class App {
|
|
name: string = 'Angular 2';
|
|
data = {};
|
|
server;
|
|
|
|
constructor(public http: Http ) {
|
|
|
|
}
|
|
|
|
|
|
ngOnInit() {
|
|
setTimeout(() => {
|
|
this.server = 'Rendered on the Server';
|
|
}, 10);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
export const routes: RouterConfig = [
|
|
{ path: '',
|
|
pathMatch: 'full',
|
|
redirectTo: 'home' },
|
|
{ path: 'home', component: HomeComponent },
|
|
{ path: 'claims', component: ClaimsAdminComponent } ];
|
|
// ,
|
|
// { path: 'claim', component: ClaimComponent },
|
|
// { path: 'search', component: SearchComponent },
|
|
// { path: 'linking', component: LinkingComponent },
|
|
// { path: 'my-claims', component: MyClaimsComponent },
|
|
// { path: 'demo', component: MyClaimsDemoComponent },
|
|
// { path: 'project', component: ProjectComponent},
|
|
// { path: 'publication', component: PublicationComponent },
|
|
// { path: 'dataset', component: DatasetComponent},
|
|
// { path: 'person', component: PersonComponent },
|
|
// { path: 'organization', component: OrganizationComponent },
|
|
// { path: 'up', component: UploadComponent},
|
|
// { path: 'bulk-linking', component: BulkLinkingComponent},
|
|
// { path: 'search-publications', component: SearchPublicationsComponent },
|
|
// { path: 'advanced-search-publications', component: AdvancedSearchPublicationsComponent },
|
|
// { path: 'deposit', component: DepositComponent}
|
|
//
|
|
// ];
|