Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs 使用Browserify时需要ui.bootstrap_Angularjs_Angular Ui Bootstrap - Fatal编程技术网

Angularjs 使用Browserify时需要ui.bootstrap

Angularjs 使用Browserify时需要ui.bootstrap,angularjs,angular-ui-bootstrap,Angularjs,Angular Ui Bootstrap,我在尝试注入对AngularUI的ui.bootstrap服务的引用时遇到了一些问题。我正在使用browserify,所以我不能只将脚本添加到基本html文件中。当我尝试调用angular.module'app',['ui.bootstrap'];我收到以下错误消息: Module 'ui.bootstrap' is not available! You either misspelled the module name or forgot to load it. If registering

我在尝试注入对AngularUI的ui.bootstrap服务的引用时遇到了一些问题。我正在使用browserify,所以我不能只将脚本添加到基本html文件中。当我尝试调用angular.module'app',['ui.bootstrap'];我收到以下错误消息:

Module 'ui.bootstrap' is not available! You either misspelled the module name
or forgot to load it. If registering a module ensure that you specify the
dependencies as the second argument.
“第二个论点”是什么意思?如果我必须使用import/require,我应该将.min.js文件放在哪里?

第二个参数是指angular.module'app',['ui.bootstrap']的第二个参数;它只是告诉您从未定义过名为ui.bootstrap的模块

你真的应该发布你的代码来得到一个更好的答案。但是,这是您通常希望对browserify执行的操作:

// require angular
var angular = require('angular');
require('angular-ui-bootstrap');  // no need to create a variable

angular.module('app', ['ui.bootstrap']); // all done
只要angular ui引导程序已经安装到您的项目npm install-save angular ui引导程序中,就应该可以工作