我正在尝试在我的 Angular 应用程序中使用 ui-bootstrap Typeahead 指令。根据安装说明看起来很简单,但是我在浏览器控制台中遇到了这个错误:
Uncaught Error: No module: ui-bootstrap
我已将模板脚本添加到我的 index.html,如下所示:
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
<script src="lib/angular/angular.js"></script>
<script src="lib/angular/angular-resource.js"></script>
<script src="js/ui-bootstrap-tpls-0.6.0.min.js"></script>
<script src="lib/bootstrap/bootstrap.js"></script>
<script src="lib/bootstrap/bootstrap-datepicker.js"></script>
<script src="lib/bootstrap/bootstrap-select.js"></script>
<script src="js/app.js"></script>
<script src="js/services.js"></script>
<script src="js/controllers.js"></script>
<script src="js/filters.js"></script>
<script src="js/directives.js"></script>
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
我已将 ui-bootstrap 指令添加到我的 app.js 文件中,如下所示:
angular.module('myApp', ['myApp.filters', 'myApp.services', 'myApp.directives', 'myApp.controllers', 'ui-bootstrap']).
config(['$routeProvider', '$httpProvider', function($routeProvider, $httpProvider) {
$routeProvider.when('/view1', {templateUrl: 'partials/partial1.html', controller: 'MyCtrl1'});
$routeProvider.when('/view2', {templateUrl: 'partials/partial2.html', controller: 'MyCtrl2'});
$routeProvider.when('/home', {templateUrl: 'partials/home.html', controller: 'BoatListCtrl'});
$routeProvider.when('/contact', {templateUrl: 'partials/contact.html', controller: 'BoatListCtrl'});
$routeProvider.otherwise({redirectTo: '/home'});
delete $httpProvider.defaults.headers.common["X-Requested-With"];
}]);
有什么建议吗?