Angular 6中的路由
当我想要导航到特定位置时,我需要使用路由。
route.navigate(['/home'], { skipLocationChange: true });
但是当返回到先前的路由时,下面的代码并没有起到帮助作用, 是否有其他方法或者应该删除 "{ skipLocationChange: true }"?
import {Component} from '@angular/core';
import {Location} from '@angular/common';
@Component({
// component's declarations here
})
class SomeComponent {
constructor(private _location: Location)
{}
backClicked() {
this._location.back();
}
}