diff --git a/angular.json b/angular.json index 5588146..7903cdf 100644 --- a/angular.json +++ b/angular.json @@ -30,8 +30,7 @@ "src/assets" ], "styles": [ - "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css", - "src/styles.css" + "src/styles.scss" ], "scripts": [] }, diff --git a/src/app/app.module.ts b/src/app/app.module.ts index dae10ef..5aab3b5 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -17,6 +17,7 @@ import { ViewerComponent } from './viewer/viewer.component'; import { LoginComponent } from './login/login.component'; import { ItemListComponent } from './items/item-list/item-list.component'; import { ItemCreateComponent } from './items/item-create/item-create.component'; +import { ItemDeleteComponent } from './items/item-delete/item-delete.component'; import { OrderComponent } from './order/order.component'; //import { NameDialogComponent } from './namedialog/namedialog.component'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; @@ -29,7 +30,8 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; ItemListComponent, LoginComponent, OrderComponent, - ItemCreateComponent + ItemCreateComponent, + ItemDeleteComponent //NameDialogComponent, ], imports: [ @@ -52,6 +54,6 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; ], providers: [], bootstrap: [AppComponent], - entryComponents: [ItemCreateComponent] + entryComponents: [ItemCreateComponent, ItemDeleteComponent] }) export class AppModule { } diff --git a/src/app/items/item-create/item-create.component.css b/src/app/items/item-create/item-create.component.css new file mode 100644 index 0000000..3267c9b --- /dev/null +++ b/src/app/items/item-create/item-create.component.css @@ -0,0 +1,3 @@ +.text { + font-family: 'Roboto-Mono', monospace; +} diff --git a/src/app/items/item-create/item-create.component.html b/src/app/items/item-create/item-create.component.html index 5b59798..8f8c4cc 100644 --- a/src/app/items/item-create/item-create.component.html +++ b/src/app/items/item-create/item-create.component.html @@ -1,14 +1,14 @@ -

Add item

+

Add item

- + - + - +
Use only numbers
@@ -17,6 +17,6 @@ - - + + diff --git a/src/app/items/item-create/item-create.component.ts b/src/app/items/item-create/item-create.component.ts index 5d88995..ed5790a 100644 --- a/src/app/items/item-create/item-create.component.ts +++ b/src/app/items/item-create/item-create.component.ts @@ -6,7 +6,8 @@ import { Item } from '../item.model'; @Component({ selector: 'app-item-create', - templateUrl: './item-create.component.html' + templateUrl: './item-create.component.html', + styleUrls: ['./item-create.component.css'] }) export class ItemCreateComponent implements OnInit { diff --git a/src/app/items/item-delete/item-delete.component.css b/src/app/items/item-delete/item-delete.component.css new file mode 100644 index 0000000..3267c9b --- /dev/null +++ b/src/app/items/item-delete/item-delete.component.css @@ -0,0 +1,3 @@ +.text { + font-family: 'Roboto-Mono', monospace; +} diff --git a/src/app/items/item-delete/item-delete.component.html b/src/app/items/item-delete/item-delete.component.html new file mode 100644 index 0000000..7002979 --- /dev/null +++ b/src/app/items/item-delete/item-delete.component.html @@ -0,0 +1,10 @@ +

Delete item

+ + +

Are you sure you want to delete "{{item.name}}"?

+
+ + + + + diff --git a/src/app/items/item-delete/item-delete.component.ts b/src/app/items/item-delete/item-delete.component.ts new file mode 100644 index 0000000..aa58f21 --- /dev/null +++ b/src/app/items/item-delete/item-delete.component.ts @@ -0,0 +1,32 @@ +import { Inject, Component, OnInit, OnDestroy, ViewEncapsulation } from '@angular/core'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { Item } from '../item.model'; + + +@Component({ + selector: 'app-item-delete', + templateUrl: './item-delete.component.html', + styleUrls: ['./item-delete.component.css'] +}) + +export class ItemDeleteComponent implements OnInit{ + item: Item; + + constructor( + private dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: Item + ) { + this.item = data; + } + + ngOnInit() { + } + + save() { + this.dialogRef.close(this.item._id); + } + + close() { + this.dialogRef.close(); + } +} diff --git a/src/app/items/item-list/item-list.component.html b/src/app/items/item-list/item-list.component.html index 3e9f5b4..41d79ed 100644 --- a/src/app/items/item-list/item-list.component.html +++ b/src/app/items/item-list/item-list.component.html @@ -23,6 +23,9 @@ +