Skip to content

Instantly share code, notes, and snippets.

@sean-clayton
Last active May 30, 2019 19:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sean-clayton/5164cbd669972ab555311225c6caaf9a to your computer and use it in GitHub Desktop.
Save sean-clayton/5164cbd669972ab555311225c6caaf9a to your computer and use it in GitHub Desktop.
/**
* 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