Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AngularJS with Sencha Touch

I came across a few projects where AngularJS is used along with Sencha Touch (for e.g. https://github.com/tigbro/sencha-touch-angular-adapter). Is there a benefit to using both together? If so, for what? I was under the impression that both of them are full fledged frameworks and you wouldn't have to mix/match.

like image 791
Mahesh Guruswamy Avatar asked Mar 28 '13 17:03

Mahesh Guruswamy


People also ask

Is Sencha Touch HTML framework?

Sencha Touch is a high-performance HTML5 mobile application framework. You can use Sencha Touch to produce a native-app-like experience inside a browser or in a hybrid shell. Sencha Touch supports Android, iOS, Windows Phone, Microsoft Surface Pro and RT, and BlackBerry devices.

What is Sencha Touch development?

Sencha Touch is a user interface (UI) JavaScript library, or web framework, specifically built for the Mobile Web. It can be used by Web developers to develop user interfaces for mobile web applications that look and feel like native applications on supported mobile devices.

Is ExtJS like react?

ExtJS is a pure JavaScript framework, meaning that the entire application is written in plain JavaScript, unlike React where the application is (typically) transpiled into JavaScript from JSX (more on this later). Although it is possible to use custom HTML components, this is rarely done in practice.

What is Sencha JS?

Sencha Ext JS is the most comprehensive JavaScript framework for building data-intensive, cross-platform web and mobile applications for any modern device.


1 Answers

IMHO, it is not worth the trouble.

Actually, it is very easy to mix other frameworks/libraries into SenchaTouch/ExtJS, and (I assume) people's motivation of doing that is mainly to get the benefit of two-way data binding into ST/Ext.

Things will be fine if you just touch the surface. Your HTML becomes clean and more maintainable, no more "weird" <tpl> tags floating around inside your JavaScript code, etc. The UI part of your project becomes beautiful.

And, you can even easily make data binding sync with simple Ext.data.Model flawlessly.

However, if you're using ST/Ext to handle data communication with backend, you're dealing with Ext.data.Store most of the time. Your collection of data come back from backend into the stores, and your models' hasMany associations are in the form of stores, just to name a few.

Now, how to sync stores with the plain JavaScript arrays or some kind of observable arrays which are used in two-way data binding? What need to be done to stores if the bound arrays changed? What need to be done to bound arrays if stores changed? Adding, removing and inserting are fairly simple operations to deal with, how about sorting and filtering?

Therefore, if you can afford to give up Ext.data.Store, mixing angular with ST/Ext is fairly easy task; otherwise, just stick with sencha.

like image 174
Ye Liu Avatar answered Sep 22 '22 02:09

Ye Liu