如何将“ui.bootstrap”依赖项添加到现有的bower组件以实现“预先”功能?
我按照给定的链接(https://angular-ui.github.io/bootstrap/)进行自动完成建议,同时异步搜索项目,需要ui.bootstrap来实现此功能,以便如何将此功能添加到现有项目中bower.json文件
我的bower.json
{
"name": "project-ui",
"version": "0.0.0",
"dependencies": {
"angular": "^1.3.0",
"bootstrap": "^3.2.0",
"angular-animate": "^1.3.0",
"angular-cookies": "^1.3.0",
"angular-resource": "^1.3.0",
"angular-route": "^1.3.0",
"angular-sanitize": "^1.3.0",
"angular-touch": "^1.3.0"
},
"devDependencies": {
"angular-mocks": "^1.3.0"
},
"appPath": "app",
"moduleName": "projectUiApp"
}
答案 0 :(得分:4)
根据文档https://github.com/angular-ui/bootstrap/blob/master/README.md#install-with-bower
运行此命令将安装并添加angular-bootstrap到dev依赖项
bower install angular-bootstrap --save-dev
然后根据https://angular-ui.github.io/bootstrap/#/getting_started
只要您已将所有文件下载并包含在您的页面中 你只需要声明对ui.bootstrap模块的依赖:
angular.module('myModule', ['ui.bootstrap']);