Skip to content

Commit

Permalink
Angular Forms In Depth
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Dec 15, 2020
1 parent 0f69262 commit bb3b8ab
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,19 @@ export class CreateCourseStep1Component implements OnInit {

this.courseCategories$ = this.courses.findCourseCategories();

const draft = localStorage.getItem("STEP_1");

if (draft) {
this.form.setValue(JSON.parse(draft));
}

this.form.valueChanges
.pipe(
filter(() => this.form.valid)
)
.subscribe( val => localStorage.setItem("STEP_1", JSON.stringify(val)));


}

get courseTitle() {
Expand Down

0 comments on commit bb3b8ab

Please sign in to comment.