简体   繁体   中英

Angular and Material Design Light

I'm triyng to implement MDL in a simple Angular app. The issue is that even if I put the MDL javascript file before the angular javascript files MDL components that rely on MDL doesn't work.

This is my scripts order:

<script src="js/material.min.js"></script>
<script src="js/jquery.swipebox.min.js"></script>
<!-- load angular, ngRoute, ngAnimate -->
<script src="http://code.angularjs.org/1.2.13/angular.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular-route.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular-animate.js"></script>
<script src="js/functions.js"></script>

How can I make other javascript libraries work with angular?

I found this and worked for me

 angular.module(...) .run(function($rootScope, $location, $timeout) { $rootScope.$on('$viewContentLoaded', function() { $timeout(function() { componentHandler.upgradeAllRegistered(); }); }); }) 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM