Search code examples
angularangular-materialcomponentsangular-components

Not allowing me to pass false value while using child to parent component interaction


Argument of type 'boolean' is not assignable to parameter of type 'string | symbol'.ts(2345)

cancel() {
this.cancelRegister.emit(false);
}

Solution

  • Your are trying to pass a boolean value to an EventEmitter that is expecting a string or symbol.

    Make sure that cancelRegister is defined like:

    cancelRegister = new EventEmitter<boolean>();
    

    OR leave it as is and pass a string value to emit