Created
April 19, 2013 08:17
-
-
Save FokkeZB/5418883 to your computer and use it in GitHub Desktop.
How to decide what window to open first in Titanium Alloy. You can remove all markup from the index.xml view (the file itself must be there!) and then create another controller based on your logic.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* /Resources/app.js - Generated by Alloy, here to understand the flow */ | |
var Alloy = require("alloy"), _ = Alloy._, Backbone = Alloy.Backbone; | |
Alloy.createController("index"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* /app/controllers/index.js */ | |
if (Ti.App.Properties.getBool('isLoggedIn', false)) { | |
Alloy.createController("home"); | |
} else { | |
Alloy.createController("login"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- /app/views/index.xml --> | |
<Alloy /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i actually ran across this issue today. I dislike the implementation and the suggested solution a lot. It would make it a hell of a lot easier to just remove the line
Alloy.createController('index')
from automatically being compiled into the build.