Pergunta

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.

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top