我写了一个小角度应用程序。我在模板中打印了一系列菜单项:
<nav id="menu">
<ul>
<li ng-repeat="i in menuItems"
ui-sref="{{ i | removeSpacesThenLowercase }}"
ui-sref-active="active">{{ i }}</li>
</ul>
</nav>
在我的 app.js 中,我使用ui-router
如下声明我的状态:
.state('camera', {
url: '/selection',
templateUrl: '/views/selection.html',
uiShade: 'light back',
back: 'intro'
})
内部 URL 工作得很好,但如果我想这样做呢?
.state('facebook', {
url: 'https://www.facebook.com/'
})
这显然是行不通的。在没有两个单独数组的情况下,在我的模板中包含一些外部(绝对)链接的最佳方法是什么?