4
I’m developing a project, but even importing all the CDN, the angular and the materialize, the materialize Javascript does not want to work together with the angular, there is some kind of conflict ?
File import:
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.min.js"/>
<script src="js/lib/angular-route.js"/>
<script src="js/lib/angular-resource.js"/>
<script src="js/main.js"></script>
<script src="js/controllers/contatos-controller.js"/>
<script src="js/controllers/contato-controller.js"/>
<script src="js/directives/minhas-diretivas.js"/>
<script src="js/services/meus-servicos.js"/>
<script src="https://code.jquery.com/jquery-2.1.1.min.js"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.6/js/materialize.min.js"/>
On the console it presents only the error:
Uncaught ReferenceError: $ is not defined(anonymous function) @materialize.min.js:6',..
Observing: I already imported the Cdn from jquery!
Is there an error shown in the browser console? Or does it just not work? Did you ever check the angular-materialize? It includes a series of directives that allows Angular to handle most of the JS components of Materialize.
– cbonomini
On the console it displays only the error 'Uncaught Referenceerror: $ is not defined(Anonymous Function) @ materialize.min.js:6',.. but css appears normally, only the steels that do not happen
– Flavio Martins
What is the order of the scripts tags? I was able to play this same error when declaring jQuery after the materialize.min.js. Try to change the order of the tags. Leave it in order: Angular, Jquery and then materialize it.
– cbonomini
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.min.js"//>
 <script src="js/lib/angular-route.js"/>
 <script src="js/lib/angular-resource.js"/>
 <script src="js/main.js"></script>
 <script src="js/controllers/contatos-controller.js"/>
 <script src="js/controllers/contato-controller.js"/>
 <script src="js/directives/minhas-diretivas.js"/>
 <script src="js/services/meus-servicos.js"/>
 <script src="https://code.jquery.com/jquery-2.1.1.min.js"/>
 <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.6/js/materialize.min.js"/>
– Flavio Martins
When I am using only the materialize I know that there is this order,. but now with the angular I’ve tried every way but the only difference is that it’s time that my angular stops working and I can’t even see if the materialize came back
– Flavio Martins
edit your question by adding the current state of the requisicoes, taking it out of the comments. Not everyone will necessarily look at them to try to help you.
– pmargreff
I don’t know if it was because you posted in the comment - but here it caused an error. Try this http://pastebin.com/p2h438FP. It was with some special character.
– cbonomini
https://krescruz.github.io/angular-materialize/
– Rafael Augusto