Last active
May 30, 2019 19:03
-
-
Save sean-clayton/5164cbd669972ab555311225c6caaf9a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Check if the component disabled value is "truthy" | |
* | |
* This check is done here due to ngc throwing an error when the logic is in the template | |
* | |
* @param disabledValue string or boolean value to evaluate | |
*/ | |
public isDisabled(disabledValue: boolean | string) { | |
if (disabledValue === true || disabledValue === "true") { | |
return true; | |
} | |
return null; | |
} | |
/* It really should be... */ | |
public isDisabled(disabledValue: boolean | string) { | |
return Boolean(disabledValue); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment