Skip to content

Commit b7d3a5a

Browse files
committed
add navigate to add-announcement-page
1 parent e0624e9 commit b7d3a5a

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

src/app/main-wall/containers/add-announcement-page/add-announcement-page.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { Component, OnInit } from '@angular/core';
55
templateUrl: './add-announcement-page.component.html',
66
styleUrls: ['./add-announcement-page.component.scss']
77
})
8+
89
export class AddAnnouncementPageComponent implements OnInit {
910

1011
constructor() { }
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
<p>
2-
main-wall-page works!
3-
</p>
1+
<button (click)="OnAddAnnouncement()" >add announcement !</button>
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Component, OnInit } from '@angular/core';
2+
import {Router, ActivatedRoute} from '@angular/router';
23

34
@Component({
45
selector: 'main-wall-page',
@@ -7,9 +8,15 @@ import { Component, OnInit } from '@angular/core';
78
})
89
export class MainWallPageComponent implements OnInit {
910

10-
constructor() { }
11+
constructor(private router:Router,
12+
private route:ActivatedRoute) { }
1113

1214
ngOnInit() {
15+
16+
}
17+
18+
OnAddAnnouncement(){
19+
this.router.navigate(['../add-announcement'], { relativeTo: this.route })
1320
}
1421

15-
}
22+
}

0 commit comments

Comments
 (0)