且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在 ui-router url 中查询字符串参数?

更新时间:2023-02-24 10:00:49

您应该修改 url 字符串属性以包含您的 customer 查询参数,如下所示:

You should modify the url string property to include your customer query parameter, like this:

.state('quotes.new', {
  url: '/new?customer',
  templateUrl: 'views/quote-form.html',
  controller: 'QuoteFormCtrl'
});

可以添加多个参数,用&分隔:

Multiple parameters can be added by separating them with an &:

.state('mystate', {
  url: '/myState?paramOne&paramTwo
  //...
});

请参阅文档