Skip to content

Instantly share code, notes, and snippets.

@gavilanch
Created June 9, 2019 23:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gavilanch/7d540bdb26e5bcf1996ba970481c0385 to your computer and use it in GitHub Desktop.
Save gavilanch/7d540bdb26e5bcf1996ba970481c0385 to your computer and use it in GitHub Desktop.
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
@Component({
selector: 'app-todo-form',
templateUrl: './todo-form.component.html',
styleUrls: ['./todo-form.component.css']
})
export class TodoFormComponent implements OnInit {
todoForm: FormGroup;
constructor(private formBuilder: FormBuilder,
  public activeModal: NgbActiveModal) { }
ngOnInit() {
    this.todoForm = this.formBuilder.group({
      title: ['', Validators.required],
      description: ['', Validators.required],
      done: false
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment