0

So i am makeing an app in Titanium alloy and i want the app to recognize an XML file i made. for example when i make a new JS file in my controller folder i need to add this code to the alloy.js file.

Alloy.createController("sub_board");

What is the code to add an xml file i created in my Views folder?

Ulrich Eckhardt
  • 16,572
  • 3
  • 28
  • 55
Mikecit22
  • 157
  • 1
  • 14

1 Answers1

2

since the controller and the view have the same base name, you do the following

// create a controller
Alloy.createController("sub_board");

the get the view

//get the view for the controller sub_board.xml
Alloy.createController("sub_board").getView();

or

// in seperate variables
var controller = Alloy.createController("sub_board");;
var view controller.getView();
Aaron Saunders
  • 33,180
  • 5
  • 60
  • 80