我试图用参数dynamicall填充ui-sref链接:
ui-sref="business({id:{{business.busId}}})"
但这不起作用。
任何帮助将不胜感激!
答案 0 :(得分:1)
如果您将状态定义为以下状态定义:
.state('business', {
parent: 'dashboard',
url: '/business/{businessId}',
controller: 'BusinessController as vm',
templateUrl: 'business.html'
})
然后你可以调用像<button ui-sref="business({businessId: business.id})"> Click me </button>
您可以通过调用$state
从控制器调用状态,如下所示:$state.go('business',{businessId: business.id});
答案 1 :(得分:0)
你刚刚尝试过:
ui-sref="business({id: business.busId})"