I was using the ngrx/router
in my app and I wanted to revert back to or replace this to the Component Router. I've noticed that both modules have a 'Router' object and where I had included Router like so:
import {
Router
} from '@ngrx/router';
I now have:
import {
Router
} from '@angular/router';
Other items I have extracted here and there but I get two main errors and I was wondering if any one can provide alternative methods or provide a solution to the two errors I have... the first error is
Property 'map' does not exist on type 'Router'.
as the previous Router was an obeserable so I do a lof of things like such:
router
.map((locationChange:LocationChange):boolean => {
// do something...
return locationChange.path === '';
})
The second issue is that the Angular Component Router has no path()
method for returning the current URL... does anyone know the way of doing this in the Angular Component Router. I'm currently looking through the documentation and trying to find an article on how to make the switch.
Many thanks in advance.