javascript - 如何允许用户单击标题部分的下一步按钮?

标签 javascript angular

我有一个按钮列表,我可以从中导航到其他页面并显示

创建变量

currentStep :number=1;

根据按钮为当前步骤添加ng-disable。

<button class="btn btn-outline-primary" (click)="first()" ng-disabled="currentStep == 1">First</button>
<button class="btn btn-outline-secondary" (click)="second()" ng-disabled="currentStep == 2">Second</button>
<button class="btn btn-outline-danger" (click)="third()" ng-disabled="currentStep == 3">Third</button>
<button class="btn btn-outline-warning" (click)="fourth()" ng-disabled="currentStep == 4">Fourth</button>
<button class="btn btn-outline-dark" (click)="fifth()" ng-disabled="currentStep == 5">Fifth</button>

不会填充数据并允许禁用的按钮传递第二页

最佳答案

创建变量

currentStep :number=1;

根据按钮为当前步骤添加ng-disable。

<button class="btn btn-outline-primary" (click)="first()" ng-disabled="currentStep == 1">First</button>
<button class="btn btn-outline-secondary" (click)="second()" ng-disabled="currentStep == 2">Second</button>
<button class="btn btn-outline-danger" (click)="third()" ng-disabled="currentStep == 3">Third</button>
<button class="btn btn-outline-warning" (click)="fourth()" ng-disabled="currentStep == 4">Fourth</button>
<button class="btn btn-outline-dark" (click)="fifth()" ng-disabled="currentStep == 5">Fifth</button>

关于javascript - 如何允许用户单击标题部分的下一步按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57054673/

相关文章:

javascript - 第三方 slider 添加具有 'class' 等属性的动态元素。我正在使用 react

javascript - 我可以为构成 D3 轴的文本和线条元素赋予唯一的类吗?

html - Google PageSpeed "Ensure text remains visible"可能节省 0 毫秒

angular - Angular2 Material 设计中的下拉列表复选框

javascript:提供的参数与调用目标的任何签名都不匹配

javascript - 将 TypeORM 存储库注入(inject) NestJS 服务以进行模拟数据测试

javascript - JSON 省略了 Infinity 和 NaN; ECMAScript 中的 JSON 状态?

javascript - 一页 Bootstrap 下拉菜单不适用于移动设备

angular - 存储在变量中的html输入文本框标签在 Angular 模板中显示它

javascript - 如何在 angular2 应用程序中导航回来?