Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
26 lines (25 sloc) 933 Bytes
<form #editForm="ngForm" (ngSubmit)="onSubmit(editForm.value)">
<input type="hidden" name="href" [(ngModel)]="note.href">
<mat-card>
<mat-card-title>
{{note?.href ? 'Edit Note' : 'Add Note'}}
</mat-card-title>
<mat-card-content>
<mat-input-container>
<textarea matInput placeholder="Note" cols="50" rows="5" name="text"
required #text="ngModel" [(ngModel)]="note.text"></textarea>
</mat-input-container>
<div [hidden]="text.valid || text.pristine">
Name is required
</div>
</mat-card-content>
<mat-card-actions>
<button mat-raised-button color="primary"
[disabled]="!editForm.form.valid">Save
</button>
<button mat-button color="warn" *ngIf="note?.href"
(click)="remove(note.href)">Delete</button>
<a mat-button routerLink="/notes">Cancel</a>
</mat-card-actions>
</mat-card>
</form>