0
I am using in a page, Angularjs and materializecss.
I am doing the angular SPA scheme, in my index.html I have a menu and a footer and among them have the tag <div ng-view></div>
I use $routeProvider to direct to the page. There’s the problem. In my route '/' I have a Parallax (component of materialize css), this component should be started according to the materialize documentation, but I start in a script on the page and does not work, like this:
init.js
(function($){
$(function(){
console.log('passa');
$('.button-collapse').sideNav();
$('.parallax').parallax();
}); // end of document ready
})(jQuery); // end of jQuery name space
and make the call normally on the index.
index.html
<script src="/assets/js/init.js"></script>
This way it works if Parallax is in my main html, but as it is in another html and this being called by the angular is not being started and does not work.
I tried to put in the page controller and the following error occurs:
Typeerror: Cannot read Property 'indexof' of Undefined at r.fn.load
Has anyone ever been through something like this? I’m a beginner in Web programming... Thanks in advance!