码迷,mamicode.com
首页 > 其他好文 > 详细

angular 通过路由获取ID

时间:2018-01-23 20:47:31      阅读:187      评论:0      收藏:0      [点我收藏+]

标签:png   service   str   body   div   this   路由   pre   router   

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

技术分享图片

 

angular 通过路由获取ID

标签:png   service   str   body   div   this   路由   pre   router   

原文地址:https://www.cnblogs.com/linsx/p/8337045.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!