sencha touch 中的配置变量
我想为我的 sencha touch 应用程序提供配置选项,例如基本 URL(以便进行 API 调用)。
当然,此配置应该位于部署时可编辑的文件中。
把这个放在哪里合适?数据存储?或者我应该在根目录的 config.js
文件中声明一个命名空间 MyApp.config
并在那里定义变量和函数?
谢谢
I would like to offer configuration options for my sencha touch application, for instance a base URL (in order to make API calls).
Of course, this configuration should be in a file editable at deployment time.
Where is the right place to put this? A data store? Or should I just declare a namespace MyApp.config
in a config.js
file at the root and define variables and functions there?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好吧,我最终定义了一个
MyApp.config
命名空间并将我的东西放在那里Well, I ended up defining a
MyApp.config
namespace and putting my stuff there我在index.php(它是index.html的替代品)中放置了一段简短的代码,它在数组中提供了必要的配置参数。
其他文件是静态的以加快加载时间。我的 app.js 可以很好地从全局 my_settings 中提取数据。
I have placed a short code in the index.php (which is replacement for index.html) which was providing necessary configuration arguments in an array.
Other files were static to speed up loading time. My app.js was pulling data from global my_settings just fine.