在TypeScript中扩展Parse SDK对象

时间:2016-06-28 11:47:58

标签: parse-platform typescript angular

为了在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.

0 个答案:

没有答案