Angular 4 个按钮禁用图标未显示
Angular 4 button disabled icon is not showing
Console image of the inspected element
问题: 当我的按钮具有禁用属性并且我将鼠标悬停在它上面时,禁用图标没有显示。
有人可以建议我如何解决这个问题吗?
我在下面附上了一段代码:
<form (ngSubmit)='onSubmit(form)' *ngIf="!submitted" #form="ngForm">
<input required #password="ngModel" [(ngModel)]="stackDefaultData.password" name="password" type="password" class="form-control">
<button type="submit" [disabled]="form.invalid">Submit</button>
</form>
这应该有效:
<button type="submit" disabled="!form.valid"
[ngStyle]="{'cursor': (!form.valid? 'not-allowed':'pointer')}">Submit</button>
Console image of the inspected element
问题: 当我的按钮具有禁用属性并且我将鼠标悬停在它上面时,禁用图标没有显示。
有人可以建议我如何解决这个问题吗?
我在下面附上了一段代码:
<form (ngSubmit)='onSubmit(form)' *ngIf="!submitted" #form="ngForm">
<input required #password="ngModel" [(ngModel)]="stackDefaultData.password" name="password" type="password" class="form-control">
<button type="submit" [disabled]="form.invalid">Submit</button>
</form>
这应该有效:
<button type="submit" disabled="!form.valid"
[ngStyle]="{'cursor': (!form.valid? 'not-allowed':'pointer')}">Submit</button>