Skip to content

Instantly share code, notes, and snippets.

@ChrisMoney
Created May 11, 2018 19:45
Show Gist options
  • Save ChrisMoney/8daf76b8c71e51670865a57919e744c8 to your computer and use it in GitHub Desktop.
Save ChrisMoney/8daf76b8c71e51670865a57919e744c8 to your computer and use it in GitHub Desktop.
Angular Edit Modal
<div mat-dialog class="container">
<div mat-dialog-title class="dialog-title">
Edit - {{ documentContent.name }}
<span class="title-spacer"></span>
<button mat-icon-button mat-dialog-close>
<mat-icon>close</mat-icon>
</button>
</div>
<div mat-dialog-content fxLayout="column" fxLayoutAlign="space-between stretch">
<mat-form-field>
<input matInput type="text" placeholder="Name" [(ngModel)]="documentContent.name" ng-maxlength="40">
</mat-form-field>
<div ng-message="maxLength" style="color:red">File name cannot be longer than 40 characters including extension.</div>
</div>
<div mat-dialog-actions>
<button mat-raised-button color="primary" (click)="saveFileName(documentContent)">Save</button>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment