What's new in v4.1.0
The latest update comes with
- improved router mechanism (added
onNavigationEndevent) - ability to either choose history based routing or hash based routing mechanism. default is history based mechanism.
- exposes
matchPathutility function to to check if current route matches with supplied regex or not. this helps to highlight navigation items. - making
getCurrentRouteasBehaviorSubjectaddress more robust usecases like maintaining state in url. when url params got changed,getCurrentRoutewill emit new queryparams data.
Breaking Changes
router.getCurrentRouteis changed toBehaviorSubject. so the usage changes torouter.getCurrentRoute().subscribe((route) => {console.log(route)})useSearchParamhook is removed infavor ofrouter.navigateTo