角度库

时间:2017-05-14 17:47:14

标签: angular angular-cli angular-compiler-cli

我为Angular 2制作了一个库,但我被困在this issue

我收到此错误:

ERROR in C:/xampp/htdocs/github/jw-bootstrap-switch-ng2/switch-project/src/$$_gendir/node_modules/jw-bootstrap-switch-ng2/src/directive.ngfactory.ts (246,59): Property 'subscribe' does not exist on type 'boolean'.

我不明白我的代码中的错误。

您可以在Github here

上查看我的代码

如果有人在这个问题上有更多经验,请告诉我。我将非常感谢你的帮助。

由于

1 个答案:

答案 0 :(得分:1)

您在此代码中的工厂出现错误

this.context.value.subscribe(_eventHandler.bind(view,'value')));

这意味着您拥有名为output

value媒体资源
@Component({
    selector: 'bSwitch',
    outputs: ['value'],

但在同一时间我看到:

get value(): boolean {
    return this._innerState;
};

set value(v: boolean) {
    if (v === null || typeof v === "undefined") this._indeterminate = true;
    this.setStateValue(v);
}

所以我会删除

outputs: ['value'],
相关问题