Angular 1 - get current URL parameters

前端 未结 6 1220
情话喂你
情话喂你 2020-11-30 03:37

I want to extract data from current URL and use it in controller. For example I have this url:

app.dev/backend/surveys/2

Bits t

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-30 04:37

    Just inject the routeParams service:

    http://docs.angularjs.org/api/ngRoute.$routeParams

提交回复
热议问题