钛的逻辑和UI分离(javascript) [英] separation of logic and UI in titanium (javascript)

查看:163
本文介绍了钛的逻辑和UI分离(javascript)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是appcelerators钛和javascript的新手,我对编写iPhone应用程序很感兴趣。我认识到需要很多代码来创建UI。到目前为止这没问题,但我倾向于明智地将该代码与我的应用程序逻辑分开。什么是最佳做法?

i'm new to appcelerators titanium and javascript and i'm interested in coding an iphone app. i recognized that there is a need of "many" code for creating the UI. that's no problem so far, but i tend to separate that code from my application logic wisely. what are the best practices?

[更新] tweetanium 是如何构建钛移动应用程序的一个很好的例子

[update] tweetanium is a great example how to structure a titanium mobile application

推荐答案

好的,我刚刚找到了一个很酷的做法。

ok, i just found a cool practice.

我包含con_file.js和应用程序逻辑view_file.js

i include the con_file.js with the application logic the view_file.js with

Titanium.include('../controller/con_file.js');

现在我可以访问空洞数据结构了。

now i'm able to access the hole data structure.

这篇关于钛的逻辑和UI分离(javascript)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆