0

I Made a library for Angular 2 but I am stuck in this issue.

I am getting this error:

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'.

and I don't understand what it's wrong in my code.

you can review my code on Github here

If anyone have more experience in this issue please let me know. I will appreciate your help.

Thanks

1 Answer 1

1

You are getting error in factory within this code

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

It means that you have output property with name value

@Component({
    selector: 'bSwitch',
    outputs: ['value'],

but in the same time i see:

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

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

So i would remove

outputs: ['value'],
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks @yurzui, but where did you find this this.context.value.subscribe(_eventHandler.bind(view,'value')));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.