<td class="text-left">
<a class="curosr" ui-sref="private.Registered_details ({uid:
x.userID,vid:x.vehicleID,page_value:'page1'})" ng-
click="linkClick(x.name,0,Registered_details/uid/vid/page_value)">{{x.name}}
</a>
</td>
在上面的代码段中,我有一个ui-sref =“private.Registered_details({uid: x.userID,vid:x.vehicleID,page_value:'page1'})“..如何通过ng-click传递这个网址到linkClick功能
答案 0 :(得分:0)
让ng-click
像这样。传递导航到您选择状态所需的所有详细信息。
<td class="text-left">
<a class="curosr" ng-click="navigateToDetails(x)">{{x.name}}
</a>
</td>
在控制器中,首先将$state
作为依赖项注入,然后使用$state.go
导航到该状态。
$scope.navigateToDetails = function(x) {
// some amazing code to decide whether or not to navigate
$state.go("private.Registered_details", {
uid: x.userID,
vid: x.vehicleID,
page_value:'page1'
});
}