I use the app-somecomponent
in the following way
<app-somecomponent required></app-somecomponent>
How do I check if app-somecomponent
has the required
attribute from the app-somecomponent.component.ts
? I don't wan't to use any value for the required attribute (so [required]="true"
, for instance is not allowed)
About the - AngularJS equivalent for hasAttribute()? - the $attr
is not available in the newer versions of Angular.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…