I just need to understand the syntax below. I am using angular-archwizard libray for my wizard in my html page.
The HTML
<aw-wizard #wizard>
<aw-wizard-step [stepTitle]="'Steptitle 1'" [canExit]="canExitStep1">
<div class="centered-content">
<div>
Content: Step 1
</div>
<div class="checkbox">
<input type="checkbox" />
<label>Allow exiting step 1</label>
</div>
<div class="btn-group">
<button type="button" class="btn btn-secondary" awNextStep>Continue</button>
</div>
</div>
</aw-wizard-step>
</aw-wizard>
TYPESCRIPT
import {Component, OnInit} from '@angular/core';
import {MovingDirection} from 'angular-archwizard';
@Component({
selector: 'app-can-exit-event',
templateUrl: './can-exit-event.component.html',
styleUrls: ['./can-exit-event.component.css']
})
export class CanExitEventComponent implements OnInit {
public canExitStep1: (MovingDirection) => boolean = (direction) => {
switch (direction) {
case MovingDirection.Forwards:
return true;
case MovingDirection.Backwards:
return false;
case MovingDirection.Stay:
return true;
}
};
constructor() {
}
ngOnInit() {
}
}
My point of interest is: [canExit]="canExitStep1" and the public canExitStep1: (MovingDirection) in the TypeScript part.
In the typescript part, is that a function and how is the MovingDirection passed? Basically I just need to understand the whole syntax from the html part to the typescript part.