Shawn
Shawn

Reputation: 2735

Alloy - Controller.addTopLevelView?

Recently I came across someone's code. The Alloy Markup is empty with just <Alloy />. In its controller, it adds a view using $.addTopLevelView().

How come I can't find any documentation regarding this function?

Upvotes: 0

Views: 135

Answers (1)

Fokke Zandbergen
Fokke Zandbergen

Reputation: 3866

Good point. It might be because it's considered private, although it would normally start with _ to indicate that since JS doesn't actually support private methods.

It is also against the very idea of Alloy to not use the XML file for the markup but instead use "classic" Titanium code in the controller together with this method.

However, it might be a good idea to do a PR against the following file to request this to be documented:

https://github.com/appcelerator/alloy/edit/master/Alloy/lib/alloy/controllers/BaseController.js

Upvotes: 1

Related Questions