【发布时间】:2016-03-10 16:31:25
【问题描述】:
我正在学习 Angular 2(使用 Ionic 2) - 有两个概念与 Angular 1 无关。
我有一个如下的课程:
import {App, Platform} from 'ionic-angular';
import {RegisterPage} from './pages/register/register';
@App({
templateUrl: 'build/index.html',
config: {} // http://ionicframework.com/docs/v2/api/config/Config/
})
export class MyApp {
static get parameters() {
return [[Platform]];
}
constructor(platform) {
this.rootPage = RegisterPage;
platform.ready().then(() => {
// The platform is now ready. Note: if this callback fails to fire, follow
// the Troubleshooting guide for a number of possible solutions:
//
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
//
// First, let's hide the keyboard accessory bar (only works natively) since
// that's a better default:
//
// Keyboard.setAccessoryBarVisible(false);
//
// For example, we might change the StatusBar color. This one below is
// good for dark backgrounds and light text:
StatusBar.setStyle(StatusBar.LIGHT_CONTENT);
});
}
}
什么是提供者,它做什么/它的目的是什么?
下面的代码做了什么:
static get parameters() {
return [[Platform]];
}
【问题讨论】:
标签: angular ionic-framework ionic2