Webjar没有在角度播种项目中解决

时间:2013-06-11 13:17:54

标签: angularjs playframework-2.0 requirejs webjars

我正在使用角度种子播放,这非常方便但是在配置更多角度依赖性时遇到了问题。

我想使用Angular UI Bootstrap,但它对我不起作用。

我的app.js基本上是

define('angular', ['webjars!angular-locale_en-gb.js'], function() {
    return angular;
});

require(['angular', './controllers', './directives', './filters', './services', 'webjars!angular-ui.js'],

function(angular, controllers) {
    angular.module('myApp', ['myApp.filters', 'myApp.services', 'myApp.directives', 'ui.bootstrap']).
    config(['$routeProvider', function($routeProvider) {
  ....
}]);

结果

Uncaught No WebJar dependency found for angular-ui-bootstrap. Please ensure that this is a valid dependency

有人能指出我正确的方向吗?

1 个答案:

答案 0 :(得分:1)

也许缺少依赖? angular-ui-bootstrap与AngularJS分开。在 Build.scala 中,添加以下内容,然后运行play update

val appDependencies = Seq(
 ...,
 "org.webjars" % "angular-ui-bootstrap" % "0.3.0-1" exclude("org.webjars", "angularjs")
)

<强> app.js

require(['angular', './controllers', './directives', './filters', './services', "webjars!ui-bootstrap.js", "webjars!ui-bootstrap-tpls.js"], function(angular, controllers, directives, filters, services) {
  angular.module("your.module", ["ui.bootstrap", "ui.bootstrap.tpls"]);
}