1

I'm using ionic/AngularJS to create a mobile app. I've seen a {{platform}} template attribute on this page: http://ionicframework.com/docs/angularjs/controllers/view-state/

How can I set this globally when I'm testing using python -mSimpleHTTPServer instead of an emulator?

4

2 回答 2

4

它很简单:

ionic.Platform.setPlatform('android')
ionic.Platform.platform() // "android"
于 2014-08-19T21:28:02.163 回答
1

似乎文档是错误的(过时的?)。
无论如何-“平台”值可在

ionic.Platform.platform

见 ionic.js:2085

于 2014-03-31T06:59:03.420 回答