## Template-Driven Form

Name @if (name.invalid && (name.dirty || name.touched)) {
@if (name.hasError('required')) {
Name is required.
} @if (name.hasError('minlength')) {
Name must be at least 4 characters long.
} @if (name.hasError('forbiddenName')) {
Name cannot be Bob.
}
}
Role @if (role.pending) {
Validating...
} @if (role.invalid) {
@if (role.hasError('uniqueRole')) {
Role is already taken.
}
}
@if (actorForm.hasError('unambiguousRole') && (actorForm.touched || actorForm.dirty)) {
Name cannot match role.
}
Skill
@if (skill.errors && skill.touched) {
@if (skill.errors['required']) {
Skill is required.
}
}

Complete the form to enable the Submit button.

@if (actorForm.submitted) {

You've submitted your actor, {{ actorForm.value.name }}!

}