Reputation: 1
Can I hide this title without hiding content? When I set "IsTitleDisabled" true, the content is hiding. I want to hide only "Title.PhoneInfo". Is there a way to do it?
<form-layout-content title="{{'Title.PhoneInfo'}}" *ngIf="!IsTitleDisabled">
<!-- content -->
</form-layout-content>
Upvotes: 0
Views: 230
Reputation: 1
I figured it out by using a method which is name is getContentTitle() from .ts side. Thanks for helping.
getContentTitle(): string {
return !this.IsTitleDisabled ? this._phoneInfoTitle : this.emptyString;
}
HTML side :
<form-layout-content title="{{getContentTitle()}}">
<!-- content -->
</form-layout-content>
Upvotes: 0
Reputation: 6016
We can bind title based on your boolean check IsTitleDisabled
to avoid it for entire content.
Do some changes like below,
<form-layout-content [attr.title]="!IsTitleDisabled ? {{'Title.PhoneInfo'}} : ''">
<!-- content -->
</form-layout-content>
If not this 'Title.PhoneInfo'
specific like constants simply we can avoid {{ }}
:
<form-layout-content [attr.title]="!IsTitleDisabled ? Title.PhoneInfo : ''">
<!-- content -->
</form-layout-content>
Upvotes: 1