我採用了棱角分明這種來自https://github.com/krescruz/angular-materialize角兌現element.leanModal不是一個函數
我有以下問題,當我把一個模式,它告訴我,element.leanModal is not a function
在控制檯上,而是,它嘗試重新加載頁面。
一切都包含在順序:
<!-- build:js(.) scripts/vendor.js -->
<!-- bower:js -->
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-animate/angular-animate.js"></script>
<script src="bower_components/angular-aria/angular-aria.js"></script>
<script src="bower_components/angular-cookies/angular-cookies.js"></script>
<script src="bower_components/angular-messages/angular-messages.js"></script>
<script src="bower_components/angular-resource/angular-resource.js"></script>
<script src="bower_components/angular-route/angular-route.js"></script>
<script src="bower_components/angular-sanitize/angular-sanitize.js"></script>
<script src="bower_components/angular-touch/angular-touch.js"></script>
<!-- endbower -->
<!-- endbuild -->
<script src="scripts/jquery-1.12.1.min.js"></script>
<script src="scripts/jquery.nicescroll.min.js"></script>
<script src="scripts/materialize.min.js"></script>
<script src="scripts/angular-materialize.js"></script>
<!-- build:js({.tmp,app}) scripts/scripts.js -->
<script src="scripts/app.js"></script>
<script src="scripts/controllers/wallCtrl.js"></script>
<script src="scripts/controllers/about.js"></script>
<script src="scripts/directives/nicescroll.js"></script>
<!-- endbuild -->
下面是模式#newpost
觸發:
...
<ul class="right hide-on-med-and-down">
<li><a href="/about">About</a></li>
<li><a href="#newpost" modal>New Post</a></li>
</ul>
...
這裏是模態片段:
<div id="newpost" class="modal modal-fixed-footer">
<form method="post">
<div class="modal-content">
<h4>New Post</h4>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action waves-effect waves-green btn-flat">Post</a>
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat">Cancel</a>
</div>
</form>
</div>
它包括作爲對我的app.js
文件的依賴:
angular
.module('leseaApp', [
'ngAnimate',
'ngAria',
'ngCookies',
'ngMessages',
'ngResource',
'ngRoute',
'ngSanitize',
'ngTouch',
'ui.materialize'
])
一切都按照文檔完成,但我有這個錯誤。任何想法可能出錯?已經過了幾個小時我已經嘗試了一切:通過bower和yeoman重新安裝,降級到舊版本,但目前爲止沒有任何效果。任何幫助將非常感激!
你解決了這個問題嗎?我遇到同樣的問題。 – vjarysta