【发布时间】:2014-02-21 09:19:22
【问题描述】:
我正在尝试在 Angular 上实现一个下拉菜单。到目前为止,我得到了要打印的项目列表,但它看起来像下图:
简单地说,它没有应用任何样式。这是我的代码的样子。
index.jade
!!!
html
head
script(src='https://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js')
script(src='js/lib/uibootstrap/ui-bootstrap-tpls-0.6.0.min.js')
...(skip)
body(ng-app="appName")
div(ng-controller="controllerName")
div(class="parent")
span(class="dropdown")
span(class="dropdown-toggle") EBOOKS
ul(class='dropdown-menu')
li(ng-repeat='item in ebook')
a(href="{{item.url}}", target="blank") {{item.title}}
page.js
angular.module('page', ['ui.bootstrap']);
function controllerName($scope) {
$scope.ebook = [{
title: 'Link to Google',
url: 'http://www.google.com/'
},
{ title: 'Link to Bing',
url: 'http://www.bing.com/'
},
{
title: 'A long title testing is being done here lalalala',
url: 'http://duckduckgo.com'
}];
}
我在这方面花了很多时间,但似乎无法取得任何突破。请帮忙。
【问题讨论】:
标签: angularjs pug angular-ui-bootstrap