Skip to content

Commit 6c542a8

Browse files
committed
Angular Forms Course
1 parent 0453389 commit 6c542a8

5 files changed

+34
-0
lines changed

src/app/app.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import {CreateCourseStepOneComponent} from './create-course/create-course-step-o
4141
import {CreateCourseStepTwoComponent} from './create-course/create-course-step-two/create-course-step-two.component';
4242
import {MatStepperModule} from '@angular/material/stepper';
4343
import { AddressFormComponent } from './address-form/address-form.component';
44+
import {CreateCourseStepThreeComponent} from './create-course/create-course-step-three/create-course-step-three.component';
4445

4546
@NgModule({
4647
declarations: [
@@ -56,6 +57,7 @@ import { AddressFormComponent } from './address-form/address-form.component';
5657
OnlyOneErrorPipe,
5758
CreateCourseStepOneComponent,
5859
CreateCourseStepTwoComponent,
60+
CreateCourseStepThreeComponent,
5961
AddressFormComponent
6062
],
6163
imports: [

src/app/create-course/create-course-step-three/create-course-step-three.component.html

Whitespace-only changes.

src/app/create-course/create-course-step-three/create-course-step-three.component.scss

Whitespace-only changes.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import {Component} from '@angular/core';
2+
import {FormBuilder, FormGroup} from '@angular/forms';
3+
4+
5+
@Component({
6+
selector: 'create-course-step-three',
7+
templateUrl: 'create-course-step-three.component.html',
8+
styleUrls: ['create-course-step-three.component.scss']
9+
})
10+
export class CreateCourseStepThreeComponent {
11+
12+
form: FormGroup = this.fb.group({});
13+
14+
15+
constructor(private fb: FormBuilder) {
16+
17+
}
18+
19+
}

src/app/create-course/create-course.component.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,19 @@ <h2 class="title">Create New Course</h2>
3131

3232
</mat-step>
3333

34+
<mat-step [stepControl]="stepThree.form" errorMessage="Course lessons in error">
35+
36+
<ng-template matStepLabel>course lessons</ng-template>
37+
38+
<create-course-step-three #stepThree></create-course-step-three>
39+
40+
<div class="stepper-buttons">
41+
<button mat-raised-button matStepperPrevious>Back</button>
42+
<button mat-raised-button color="primary" matStepperNext [disabled]="!stepThree.form.valid">Create Course</button>
43+
</div>
44+
45+
</mat-step>
46+
3447
</mat-horizontal-stepper>
3548

3649
</div>

0 commit comments

Comments
 (0)