猿问

angularjs怎么样验证url是否正确

angularjs怎么样验证url是否正确


慕容3067478
浏览 520回答 2
2回答

胡子哥哥

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});}
随时随地看视频慕课网APP

相关分类

AngularJS
我要回答