当我点击导航时,我得到标题上的错误。
我可以看到item.name为" Page"在导航菜单上
当我将ui-sref更改为{{item.url}}时,它会给出:无效状态参考''
导航HTML:
<li data-ng-repeat="item in items">
<a ui-sref="item.url">{{item.name}}</a>
</li>
routes.js:
$locationProvider.html5Mode(true);
$urlRouterProvider.otherwise('/home');
$stateProvider
.state('page', {url: '/page', templateUrl: 'views/page.html', controller: ''});
项目json:
{
"items" : [
{"id": 1, "name": "Page", "alignment": "left", "url": "page", "sub" : false},
{"id": 2, "name": "Projects", "alignment": "left", "url": "projects", "sub": false}]
}