我正在使用angularFire和ui bootstrap。我的所有样式都很好,但没有任何javascript细节正常工作。我使用的是非常厚的模板(大量的插件和文件),所以我尝试在index.html中排序脚本标签的位置无济于事。例如:datepicker,范围,模态都不起作用,但我没有在控制台中收到任何错误。这真让我抓狂!这里有一些代码...希望它有所帮助。
在结束正文标记之前调用Index.html bower脚本:
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/json3/lib/json3.js"></script>
<script src="bower_components/bootstrap/dist/js/bootstrap.js"></script>
<script src="bower_components/angular-bootstrap/ui-bootstrap.min.js"></script>
<script src="bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>
<script src="bower_components/angular-resource/angular-resource.js"></script>
<script src="bower_components/angular-cookies/angular-cookies.js"></script>
<script src="bower_components/angular-sanitize/angular-sanitize.js"></script>
<script src="bower_components/angular-animate/angular-animate.js"></script>
<script src="bower_components/angular-touch/angular-touch.js"></script>
<script src="bower_components/angular-route/angular-route.js"></script>
<script src="bower_components/firebase/firebase.js"></script>
<script src="bower_components/firebase-simple-login/firebase-simple-login.js"></script>
<script src="bower_components/mockfirebase/dist/mockfirebase.js"></script>
<script src="bower_components/angularfire/dist/angularfire.min.js"></script>
<script src="bower_components/angular-payments/lib/angular-payments.js"></script>
<!-- endbower -->
angular.module调用:
angular.module('vagaApp', [
'ngAnimate',
'ui.bootstrap',
'angularPayments',
'ngCookies',
'ngResource',
'ngRoute',
'ngSanitize',
'ngTouch',
'firebase',
'firebase.utils',
'simpleLogin',
'mm.foundation',
'angularSpinner'
]);
代码不工作的示例:
<h4>Popup</h4>
<div class="row">
<div class="col-md-6">
<p class="input-group">
<input type="text" class="form-control" datepicker-popup="{{format}}" ng-model="dt" is-open="opened" min-date="minDate" max-date="'2015-06-22'" datepicker-options="dateOptions" date-disabled="disabled(date, mode)" ng-required="true" close-text="Close" />
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="open($event)"><i class="glyphicon glyphicon-calendar"></i></button>
</span>
</p>
</div>
</div>
<div class="row">
<div class="col-md-6">
<label>Format:</label> <select class="form-control" ng-model="format" ng-options="f for f in formats"><option></option></select>
</div>
</div>
答案 0 :(得分:0)
&#34;确保在项目中只包含一个文件。&#34;
来自:https://github.com/angular-ui/bootstrap/wiki/FAQ
这可能是你的问题吗? 尝试删除&#39; ui-bootstrap.min.js&#39;
更多关于* tpls.min.js和* min.js之间的区别:
What is the difference between ui-bootstrap-tpls.min.js and ui-bootstrap.min.js?