40 lines
1.7 KiB
HTML
40 lines
1.7 KiB
HTML
<!-- Trigger the modal with a button -->
|
|
<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#editModal"><i class="fa fa-pencil" aria-hidden="true"></i></button>
|
|
|
|
<!-- Modal -->
|
|
<div id="editModal" class="modal fade" role="dialog">
|
|
<div class="modal-dialog">
|
|
|
|
<!-- Modal content-->
|
|
<div class="modal-content">
|
|
<form id="myForm" #editForm="ngForm" (ngSubmit)="onSubmit()">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
<h4 class="modal-title">Edit {{model.name}}</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
|
|
<div class="form-group">
|
|
<label for="name">Name</label>
|
|
<input type="text" class="form-control" id="name" required [(ngModel)]="user.name" name="name" #name="ngModel" ngModel>
|
|
<div [hidden]="name.valid || name.pristine" class="alert alert-danger">
|
|
Name is required
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="role">Role</label>
|
|
<select type="text" class="form-control" id="role" [(ngModel)]="user.role" name="role" #role="ngModel" required ngModel>
|
|
<option *ngFor="let rol of roles" [value]="rol">{{rol}}</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="submit" class="btn btn-success" form="myForm" data-dismiss="modal" (click)="onSubmit()" [disabled]="!editForm.form.valid">Edit User</button>
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|