1
所以我的HTML是:角NG-重複錯誤
<div class="checkbox" ng-repeat="test in tests">
<a ui-sref="test{{id: test._id}}"><pre>{{test._id}}</pre></a>
</div>
我在app.js路由器配置
myApp.config(function($stateProvider, $urlRouterProvider){
$urlRouterProvider.otherwise("");
$stateProvider
.state('main', {
url: ""
})
.state('new', {
url: "/new",
templateUrl: "templates/new.html"
})
.state('test', {
url: "/tests/:id",
templateUrl: "templates/test.html"
})
});
我有一個錯誤,控制檯拋出
Error: Syntax Error: Token ':' is an unexpected token at column 3 of the expression [id: test._id] starting at [: test._id]. at Error (native) What the problem?
你吧,謝謝。 – user2971752
很好,如果有幫助:這是一個鏈接到文檔http://angular-ui.github.io/ui-router/site/#/api/ui.router.state.directive:ui-sref –