added routing
This commit is contained in:
parent
3fe70e52ad
commit
d07159dfde
2 changed files with 13 additions and 1 deletions
|
|
@ -14,6 +14,7 @@ export const routes: Routes = [
|
|||
{ path: '', component: SummaryComponent },
|
||||
{ path: 'summary', component: SummaryComponent },
|
||||
{ path: 'add-task', component: AddTaskComponent },
|
||||
{ path: 'add-task/:id', component: AddTaskComponent },
|
||||
{ path: 'board', component: BoardComponent },
|
||||
{ path: 'task/:id', component: TaskOverlayComponent },
|
||||
{ path: 'task-edit/:id', component: TaskEditOverlayComponent },
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import { Task } from '../../interfaces/task.interface';
|
|||
import { OverlayService } from '../../services/overlay.service';
|
||||
import { empty } from 'rxjs';
|
||||
import { FormBtnComponent } from '../../shared/components/buttons/form-btn/form-btn.component';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'app-add-task',
|
||||
|
|
@ -37,7 +38,8 @@ export class AddTaskComponent {
|
|||
|
||||
constructor(
|
||||
public firebaseService: FirebaseService,
|
||||
private overlayService: OverlayService
|
||||
private overlayService: OverlayService,
|
||||
private route: ActivatedRoute
|
||||
) {}
|
||||
|
||||
taskData: Task = {
|
||||
|
|
@ -54,6 +56,7 @@ export class AddTaskComponent {
|
|||
|
||||
ngOnInit() {
|
||||
this.loadEditTaskData();
|
||||
this.routeParams();
|
||||
this.loadLocalStorageData();
|
||||
}
|
||||
|
||||
|
|
@ -67,6 +70,14 @@ export class AddTaskComponent {
|
|||
this.dialogY = event.clientY + 10;
|
||||
}
|
||||
|
||||
routeParams() {
|
||||
if (this.route.params.subscribe()) {
|
||||
this.route.params.subscribe((params) => {
|
||||
this.taskData.status = params['id'];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
closeDialog() {
|
||||
this.AssignedDialogId = '';
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue