You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+78-1Lines changed: 78 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -641,4 +641,81 @@ export class DepartmentDetailsComponent implements OnInit {
641
641
</figure>
642
642
</p>
643
643
644
-
644
+
5 Optional Route Parameters
645
+
=====================
646
+
- By using `Back button in department-details.component.html` we must `navigate back to department-list.component.html` and show clicked department in selected state`
647
+
1. In department-details.component add `Back` button: `<button click="goToDepartments()">Back </button> `
648
+
2. In `department-details.component.ts` create a handler ` goToDepartments()` with required logic,
649
+
// Use Back button to go to main list page and highlight the link by passing optional parameters with departments details, when back it shows in url `http://localhost:5000/departments;id=4`
650
+
3. In `department-list.component.ts` add required login in `ngOnInit()` life cycle hook to read the passed optional parameter and to highlight clicked department button
0 commit comments