angular material open last visited tab
constructor(private route: ActivatedRoute,
private router: Router) {}
selectedTabIndex: number;
ngOnInit(): void {
this.selectedTabIndex = parseInt(this.route.snapshot.queryParamMap.get('tab'), 10);
// TODO: check upper bound. Material will set the last tab as selected
// if selectedTabIndex >= number of tabs
if (isNaN(this.selectedTabIndex) || this.selectedTabIndex < 0) {
this.selectedTabIndex = 0;
}
}
onTabChange(selectedTabIndex: number): void {
this.router.navigate([], { relativeTo: this.route, queryParams: {
tab: selectedTabIndex
}});
this.selectedTabIndex = selectedTabIndex;
}
Also in JavaScript:
- escape in javascript
- capitalise first letter js
- min value javascript
- localstorage.getitem()
- react redux counter tutorial
- react ntive
- How to remove the first and the last character of a string
- use jquery in jsbench me
- jquery append before
- webpack proxy
- html video tag autoplay not working
- lifecycle methods react
- axios download excel \ file
- jquery ready function
- update table remove a key from json object mysql
- dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.66.dylib Referenced from: /usr/local/bin/node Reason: image not found
- javascript steps
- gitignore for angular
- cJSON_CreateObject
- how to make a circle in js
- js format urcurency
- how to use react fragment
- jquery slideup
- isDate javascript