• support@answerspoint.com

Conflict when linking angularjs modules with ionic framework

530

 

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.

 


  

 

 

 

1Answer


0

The hint can be found in this documentation

http://ionicframework.com/docs/guide/starting.html

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 2 years ago
  • Gul Hafiz

Your Answer

    Facebook Share