سؤال

What is the proper way to separate the view and controller with Alloy?

someController.js:

$.list.setSections(sections);, I know this populates a ListView with id='list' in the XML markup...

or

var list = Ti.UI.createListView({stuff}) and then somehow push the list out to the view.

I am not sure what the best way is to keep in spirit with MVC.

هل كانت مفيدة؟

المحلول

if you are using alloy, you should create the list in XML, in the actual view file. then you can do stuff with it in the controller using $.list, as you do in your first option.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top