几天来,我一直在尝试寻找与 Angular 2(我正在使用 Ionic 2)一起使用的 MBAAS。Parse 正在关闭,所以这对我来说并不是一个真正的选择,我尝试过的其他人(Firebase、Backendless 等)似乎还没有 Angular 2 SDK。
可能是我不耐烦了,但我现在真的很想开始使用它,但我不能没有像样的 SDK。
是的,如果我真的想要的话,我也可以使用 REST API,但我觉得这会限制应用程序需要的简单推送通知等的能力。
所以问题是:有谁知道支持 Angular 2 并且有一个可用于支持推送通知和数据存储的库的 MBAAS?
编辑:
因此,例如,尝试在 Angular 2 中使用后端 mbaas,我尝试了以下方法:
结构:
- app
- app.js
- backendless.js
-- pages
--- home
---- home.html
---- home.js
---- home.scss
-- theme
应用程序.js
import {App, Platform} from 'ionic-angular';
import {HomePage} from './pages/home/home';
import {Backendless} from 'backendless';
@App({
template: '<ion-nav [root]="rootPage"></ion-nav>',
config: {} // http://ionicframework.com/docs/v2/api/config/Config/
})
export class NotOnFileApp {
static get parameters() {
return [[Platform]];
}
constructor(platform) {
this.rootPage = HomePage;
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)
Backendless.initApp( 'XXXXX', 'XXXXX', 'v1' );
});
}
}
这给出了错误:“无法读取未定义的属性'initApp'”,这表明我没有正确导入 js 库。你能帮忙解释一下为什么会这样吗?