Added create product
This commit is contained in:
33
src/app/store/newProduct/newProduct.component.html
Normal file
33
src/app/store/newProduct/newProduct.component.html
Normal file
@ -0,0 +1,33 @@
|
||||
<mat-dialog-content>
|
||||
<h3 mat-dialog-title>
|
||||
<span *ngIf="data.product">Update</span>
|
||||
<span *ngIf="!data.product">Create</span> Product</h3>
|
||||
<form id="createForm">
|
||||
<mat-form-field class="w-100">
|
||||
<input matInput placeholder="Name" name="name" [(ngModel)]="name">
|
||||
</mat-form-field>
|
||||
<mat-form-field class="w-100">
|
||||
<mat-select placeholder="Category" name="category" [(value)]="category">
|
||||
<mat-option *ngFor="let c of categories | async" [value]="c.name">{{c.name}}</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field class="w-100">
|
||||
<textarea matInput rows="5" placeholder="Description" name="description" [(ngModel)]="description"></textarea>
|
||||
</mat-form-field>
|
||||
<mat-form-field>
|
||||
<input matInput placeholder="Price" type="number" name="price" [(ngModel)]="price">
|
||||
<span matPrefix>$ </span>
|
||||
</mat-form-field>
|
||||
<input #fileInput type="file" (change)="imageChanged()" hidden>
|
||||
</form>
|
||||
</mat-dialog-content>
|
||||
<mat-dialog-actions>
|
||||
<button mat-raised-button (click)="fileInput.click()">
|
||||
<span *ngIf="!image">Add Image</span>
|
||||
<mat-icon *ngIf="image">check</mat-icon>
|
||||
</button>
|
||||
<button mat-raised-button type="submit" form="createForm" color="primary" (click)="submit()">
|
||||
<span *ngIf="data.product">Update</span>
|
||||
<span *ngIf="!data.product">Create</span>
|
||||
</button>
|
||||
</mat-dialog-actions>
|
Reference in New Issue
Block a user