selector : td-steps
Element generates a stepper to be used in a wizard flow.
Simply wrap the <td-step>
elements you need with a <td-steps>
element.
Example
HTML
<td-steps (stepChange)="change($event)" mode="'vertical'|'horizontal'"> <td-step> ... </td-step> ... </td-steps>
TypeScript
import { IStepChangeEvent } from '@covalent/core/steps'; ... }) export class Demo { change(event: IStepChangeEvent): void { ... }; }
Selector: td-step
Add as many <td-step>
elements you need wrapped by a <td-steps>
element for control.
Uses StepState enum to define step state value [StepState.None, StepState.Required and StepState.Complete].
Enum values can be replaced with strings [“none”, “required” and “complete”].
Note: Components in Angular do not have 2-way binding, so the active variable might be off sync with its [TdStepComponent] sometimes.
You can keep it in sync with the (activated/deactivated) events if there is a need to do it.
Example
HTML
<td-step #step label="Label" sublabel="Sublabel" [active]="active" [disabled]="disabled" [state]="state" (activated)="activeEvent()" (deactivated)="deactiveEvent()" [disableRipple]="false"> <ng-template td-step-label> ... add label content (if not used, falls back to [label] input) </ng-template> ... add content that will be shown when the step is "active" <ng-template td-step-actions> <button (click)="step.close()">Close</button> ... add button elements for the step content (optional) </ng-template> <ng-template td-step-summary> ... add summary that will be shown when step in is "complete" state (optional) </ng-template> </td-step>
TypeScript
import { StepState } from '@covalent/core/steps'; ... }) export class Demo { active: boolean = false; disabled: boolean = false; state: StepState = StepState.Required; // or state: string = "required"; activeEvent(): void { ... }; deactiveEvent(): void { ... }; }
Import the [CovalentStepsModule] in your NgModule:
import { CovalentStepsModule } from '@covalent/core/steps'; @NgModule({ imports: [ CovalentStepsModule, ... ], ... }) export class MyModule {}