tabs and routing for projects and dmps
This commit is contained in:
parent
1d4d32197c
commit
a45a3efdcf
|
@ -55,8 +55,7 @@ export class DmpComponent implements OnInit{
|
||||||
});
|
});
|
||||||
this.dmps = [];
|
this.dmps = [];
|
||||||
this.serverService.getDmpOfUser().subscribe(
|
this.serverService.getDmpOfUser().subscribe(
|
||||||
response => {
|
response => {
|
||||||
debugger;
|
|
||||||
|
|
||||||
response.forEach(resp => {
|
response.forEach(resp => {
|
||||||
let pr = new Dmp();
|
let pr = new Dmp();
|
||||||
|
@ -131,7 +130,7 @@ myFunction() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SaveNewDmp(){ debugger;
|
SaveNewDmp(){
|
||||||
console.log(this.dmp, this.dmp.projectsDropDownKey);
|
console.log(this.dmp, this.dmp.projectsDropDownKey);
|
||||||
//this.http.post('http://someurl', JSON.stringify(this.project))
|
//this.http.post('http://someurl', JSON.stringify(this.project))
|
||||||
this.serverService.createDmpForProject(this.dmp, this.dmp.projectsDropDownKey)
|
this.serverService.createDmpForProject(this.dmp, this.dmp.projectsDropDownKey)
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
<meta name="google-signin-client_id" content="524432312250-vhgidft856v8qftsc81kls4c74v87d8o.apps.googleusercontent.com">
|
<meta name="google-signin-client_id" content="524432312250-vhgidft856v8qftsc81kls4c74v87d8o.apps.googleusercontent.com">
|
||||||
|
|
||||||
<nav>
|
|
||||||
<a routerLink="projects" routerLinkActive="active">Projects</a>
|
|
||||||
<a routerLink="dmps" routerLinkActive="active">My Dmps</a>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div style="margin: auto; max-width: 1000px; margin-top:50px">
|
<div style="margin: auto; max-width: 1000px; margin-top:50px">
|
||||||
<div>
|
<div>
|
||||||
<span>Filter: </span>
|
<span>Filter: </span>
|
||||||
|
|
|
@ -1,13 +1,25 @@
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { RouterModule, Routes } from '@angular/router';
|
import { RouterModule, Routes } from '@angular/router';
|
||||||
|
|
||||||
import { TabComponent } from './tabs.component';
|
import { TabComponent } from './tabs.component';
|
||||||
import { AuthGuard } from '../guards/auth.guard';
|
import { AuthGuard } from '../guards/auth.guard';
|
||||||
import { ProjectsComponent } from '../projects/projects.component';
|
import { ProjectsComponent } from '../projects/projects.component';
|
||||||
import { DmpComponent } from '../dmps/dmp.component';
|
import { DmpComponent } from '../dmps/dmp.component';
|
||||||
|
|
||||||
const tabsRoutes: Routes = [
|
const tabsRoutes: Routes = [
|
||||||
{ path: 'tabs', component: TabComponent, canActivate: [AuthGuard] },
|
{
|
||||||
|
path: 'tabs', component: TabComponent, canActivate: [AuthGuard],
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'projects',
|
||||||
|
component: ProjectsComponent
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'dmps',
|
||||||
|
component: DmpComponent
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{ path: 'tabs/projects', component: ProjectsComponent }, // canActivate: [AuthGuard]
|
{ path: 'tabs/projects', component: ProjectsComponent }, // canActivate: [AuthGuard]
|
||||||
{ path: 'tabs/dmps', component: DmpComponent }
|
{ path: 'tabs/dmps', component: DmpComponent }
|
||||||
];
|
];
|
||||||
|
|
|
@ -3,13 +3,25 @@ import { Component } from '@angular/core';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-app',
|
selector: 'my-app',
|
||||||
template: `
|
template: `
|
||||||
<h1 class="title">Angular Router</h1>
|
<ul class="nav nav-tabs">
|
||||||
<nav>
|
<li class="nav-item">
|
||||||
<a routerLink="projects" routerLinkActive="active">Projects</a>
|
<a class="nav-link active" routerLink="projects" routerLinkActive="active">Projects</a>
|
||||||
<a routerLink="dmps" routerLinkActive="active">My Dmps</a>
|
</li>
|
||||||
</nav>
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" routerLink="dmps" routerLinkActive="active">My Dmps</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<router-outlet></router-outlet>
|
<router-outlet></router-outlet>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
export class TabComponent {
|
export class TabComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// <nav>
|
||||||
|
// <a routerLink="projects" routerLinkActive="active">Projects</a>
|
||||||
|
// <a routerLink="dmps" routerLinkActive="active">My Dmps</a>
|
||||||
|
// </nav>
|
Loading…
Reference in New Issue