Reputation: 8841
I am working on an angular 2 project and I am using a library called ng2-bootstrap
.
I am using modals from this library, and there is a property called _isShown
that I am checking in a function inside my class:
proceed() {
if (this.childModal._isShown) this.hideChildModal(); // error message here: "[ts] Property '_isShown' is protected and only accessible within class 'ModalDirective' and its subclasses."
this.router.navigate(['signup-step-two']);
}
It seems to work even though I get that error, but how can I fix that error correctly?
Thanks
Upvotes: 0
Views: 883
Reputation: 8992
Because _isShown
is protected
in ModalDirective
source code. Check it out here.
You can access the public value using isShown()
function.
It is declared as public
in the source code.
public get isShown(): boolean {
return this._isShown;
}
Upvotes: 2