更新时间:2023-02-26 14:18:56
创建一个预订router
的全局服务,并将该服务注入到您想知道的有关路由更改的任何位置.该服务可以通过Observable
本身公开更改,因此感兴趣的组件也可以订阅以自动获得通知.
Create a global service that subscribes to router
and inject the service wherever you want to know about route changes. The service can expose changes by an Observable
itself so interested components also can subscribe to get notified automatically.