为了在angular2中为Parse对象定义简单的getter和setter,我想像这样扩展Parse.Object:
const Parse = require('parse').Parse;
export class Test extends Parse.Object {
constructor() {
super('Test');
}
get items():Array<string> {
return super.get('items');
}
set items(value:Array<string>) {
super.set('items', value);
}
}
Parse.Object.registerSubclass('Test', Test);
但是,我收到以下错误:
error TS2507: Type 'any' is not a constructor function type.