Conflict when linking angularjs modules with ionic framework
I am trying to port an existing angularjs app to ionic. The ionic project was created with;
$ ionic start myApp tabs
Then, I combined the links from my angularjs app and ionic app together.
- asked 7 years ago
- B Butts
The hint can be found in this documentation
Ionic comes with ngAnimate and ngSanitize bundled in, but to use other Angular modules you’ll need to include them from the lib/js/angular directory.
ionic.bundle.js already comes bundled with animate module. So, your html file creates conflict when you link in the angularjs animate module.
In your html file, comment away the following lines. This should be enough to solve your problem.
<!--<script src="../../bower_components/angular/angular.min.js"></script>--> <!--<script src="../../bower_components/angular-animate/angular-animate.min.js"></script>-->
Please note that your other js modules need to be placed in
lib/js. They can be placed in sub-folders in
lib/js. Otherwise, it will work well when testing on desktop browser but fail to work on the smartphone.
- answered 7 years ago
- Gul Hafiz