Skip to content

Instantly share code, notes, and snippets.

@gavilanch
Last active June 9, 2019 22:56
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/f5b80c26ab8cd40b0a06716c5b642b37 to your computer and use it in GitHub Desktop.
Save gavilanch/f5b80c26ab8cd40b0a06716c5b642b37 to your computer and use it in GitHub Desktop.
<div class="modal-header">
 <h4 class="modal-title">Create Todo</h4>
 <button type="button" class="close" aria-label="Close" (click)="activeModal.dismiss('Cross click')">
   <span aria-hidden="true">&times;</span>
 </button>
</div>
<div class="modal-body">
 <form [formGroup]="todoForm" (ngSubmit)="saveTodo()">
   <div class="form-group">
     <label for="title">Title*</label>
     <input type="text" id="title" placeholder="Title" class="form-control" formControlName="title" />
     <span style="color:Red;" *ngIf="todoForm.controls['title'].touched && todoForm.controls['title'].errors?.required">Title
       is required.</span>
   </div>
   <div class="form-group">
     <label for="description">Description*</label>
     <textarea  id="description" placeholder="Description" class="form-control" formControlName="description"></textarea>
     <span style="color:rgb(238, 235, 235);" *ngIf="todoForm.controls['description'].touched && todoForm.controls['description'].errors?.required">Description
       is required.</span>
   </div>
   <div class="form-check">
     <input class="form-check-input" type="checkbox" value="" id="done" formControlName="done">
     <label class="form-check-label" for="done">
       Done
     </label>
   </div>
 </form>
</div>
<div class="modal-footer">
 <button type="button" class="btn btn-outline-dark" (click)="activeModal.close('Close click')">Close</button>
 <button class="btn btn-primary" (click)="saveTodo()" [disabled]="todoForm.invalid">Save</button>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment