I have this isData
variable declared in my ts file
isData:boolean=false;
i have this button on my component
<button
class="btn btn-primary"
type="button"
(click)="save()"
*ngIf="isData===false"
>
Save
</button>
isData
is false but button is not shown i have tried with isData=='false'
this also same issue.
Any solution Thanks
This should do the trick:
*ngIf="!isData"
If I understood correctly, you wish to enable the button when there isData
is false
.
However, ngIf
needs to be true
for it to enable the button.
@nate-kumar's answer should work assuming isData is false..
If somehow ngIf is not working in angular, you may try hidden property with the inverse condition
<button
class="btn btn-primary"
type="button"
(click)="save()"
[hidden]="!isData"
>
Save
</button>
I hope this will help you for the problem.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.