Notice: The Monaca & Onsen UI Community Forum is shutting down.
For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.
Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.
How to add ngAnimate module?
-
How can I add the ngAnimate module?
I’ve tried to add ngAnimate javascript component and add it to ons.bootstrap function but it doesn’t seem to work.
-
@antoniomc said:
add the ngAnimate module
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <script type="text/javascript" src="angular.min.js"></script> <script type="text/javascript" src="angular-sanitize.min.js"></script> <script type="text/javascript" src="angular-animate.min.js"></script> <script type="text/javascript" src="app.js"></script> </head> <body> <div ng-app="MyApp" ng-controller="MyCtrl"> {{item.title}} </div> </body> </html>
var nameSpace = angular.module('MyApp', ['ngSanitize','ngAnimate']); nameSpace.controller('MyCtrl',['$scope',function($scope) { $scope.item={ 'title' : 'Show a text' }; }]);
-
@Leonardo-Augusto said:
ngSanitize
Just remember to include
ngSanitize
module into your HTML, afterangular
, as it’s not included by default into the Angular lib.<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script>
-
@Andi thanks for remember!
-
You are welcome! :)
I had to deal with it just a few days ago :P
-
I know you guys like Angular, but I sure would like to convince you to the dark side errr, the vanilla side! :stuck_out_tongue:
-
@munsterlander I’m actually trying to switch totally to vanilla js but I still find some Angular’s functionalities, like two-way binding, very useful :P
-
@munsterlander After writing the last To-Do List app in Vanilla JS I don’t want to go back to AngularJS anymore. In Onsen UI 2.0 Vanilla JS rocks :smirk:
-
@Fran-Diox I agree 100%! I like frameworks, but now with promises and all that you guys have been implementing, there is no need to rely on anything else. The only advantage Angular has is data binding, but this is solved by using your own listeners. Much much more granular control, cleaner code, and in my opinion far less code as well which then would mean performance gains for not loading additional unused items to memory. Love love love what the Onsen team is doing! Amazing stuff and great job! :heartpulse: :bowtie:
-
@munsterlander lol Yes i like Angular. But you and @Fran-Diox always talk about Vanilla! So i’ll check .
said:
I know you guys like Angular, but I sure would like to convince you to the dark side errr, the vanilla side! :stuck_out_tongue:
-
@Leonardo-Augusto I think Angular is quite heavy for simple apps. Most of the things you want to do are probably made easier with Vanilla so there is no need to make the code more complex. But of course it depends on the app and the developer :)
-
@Fran-Diox thanks for ur comment!