angularjs怎么样验证url是否正确
2 回答
慕村225694
TA贡献1880条经验 获得超4个赞
import { Component, OnInit, Inject } from '@angular/core';
import {ActivatedRoute, Params} from '@angular/router';
@Component({
selector: 'demo',
template: `<div></div>`
})
export class DemoComponent implements OnInit {
constructor(@Inject(ActivatedRoute) private router: ActivatedRoute) { }
ngOnInit() {
this.router.params.subscribe((params: Params) => {
// params
});
}
- 2 回答
- 0 关注
- 869 浏览
添加回答
举报
0/150
提交
取消