constructor( private dataService: TestListsService, private route: ActivatedRoute, ) { // 通过路由获取ID console.log(route); this.id = this.route.params.value['id']; }
import { ActivatedRoute } from '@angular/router';