I am trying to run the function .parallax() from Materialize framework using routes in the angularjs. I already config the command document.ready for each template but this doesn't work. This works just in the first time. What is the best way to make document.ready calling functions like $('.test').test(); using routes? I will wait! Thanks!
Template HTML of my route:
<!-- JS -->
<script type="text/javascript">
$(document).ready(function(){
$('.parallax').parallax(); //Run just in the first time
};
</script>
<!-- Template -->
<div class="" ng-controller="homeCtrl">
...
</div>
Controller:
app.controller('homeCtrl', ['$scope', function($scope){
//Ready
angular.element(document).ready(function() {
$('.parallax').parallax(); // Doesn't work
});
}]);
Thanks!