Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pros and cons of using AngularJS + jQuery Mobile in one project

Tags:

We're about to start a project using mentioned libraries. We have already used jQM in another project, but coupled with Backbone. Now we're thinking about using AngularJS with jQM. Do you think it's a good idea? And if not, why?

To elaborate, the question is whether it is advisable/recommended/easy/beneficial to use these libraries together, or maybe there is something that should prevent us from using them both in one project. We don't want to spend half of project's time on making them work together just on principle.

like image 478
piotr.d Avatar asked May 13 '13 08:05

piotr.d


People also ask

What is the advantage of AngularJS over JavaScript?

AngularJS uses dependency injection and make use of separation of concerns. AngularJS provides reusable components. With AngularJS, the developers can achieve more functionality with short code. In AngularJS, views are pure html pages, and controllers written in JavaScript do the business processing.

How can you integrate AngularJS with HTML?

AngularJS is a JavaScript framework. It can be added to an HTML page with a <script> tag.


1 Answers

AngularJS and JQM do different things. AngularJS is MVC + Lot More. JQM on the other hand is for direct UI manipulation (lower level than Angular). The good news is AngularJS is flexible and will let you work with any other Javascript framework including JQM. The recommended way of using them together is use the adapter as mentioned above or create your own reusable directives that will add "JQM nature" to your views. For e.g. you can create a directive that will convert a standard UL to a fancier JQM list. The good thing about doing this in directives and not within your view is that your UI code is separated in separate modules and not intermingled with business logic.

like image 199
Ketan Avatar answered Sep 28 '22 10:09

Ketan