(, ) :
this.router.events
.filter(event => event instanceof NavigationStart)
.subscribe(event => {
this.http.post('').subscribe();
});
.
, ActivateRoute params.
combineLatest Observable, :
export class AppComponent {
constructor(private router: Router, private route: ActivatedRoute) {
Observable.combineLatest(
this.router.events
.filter(event => event instanceof NavigationStart),
this.route.params
)
.subscribe(data => {
const event = data[0];
const params = data[1];
(...)
});
}
}
:
import 'rxjs/add/observable/combineLatest';