From 4952587c10e8e9c1b74ac68d6fa86538fa9bf491 Mon Sep 17 00:00:00 2001 From: Zak Timson Date: Sat, 14 Jul 2018 19:20:38 -0400 Subject: [PATCH] Create custom categories --- src/app/app.module.ts | 4 ++- src/app/login/login.component.ts | 6 ++-- src/app/store/categories.component.html | 1 + src/app/store/categories.component.ts | 7 ++++ .../newCategory/newCategory.component.html | 21 +++++++++++ .../newCategory/newCategory.component.ts | 36 +++++++++++++++++++ 6 files changed, 71 insertions(+), 4 deletions(-) create mode 100644 src/app/store/newCategory/newCategory.component.html create mode 100644 src/app/store/newCategory/newCategory.component.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 033f08d..ca71b35 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -20,6 +20,7 @@ import {AngularFireStorageModule} from 'angularfire2/storage'; import {BreadcrumbService} from './store/breadcrumb.service'; import {LoginComponent} from './login/login.component'; import {AngularFireAuthModule} from 'angularfire2/auth'; +import {NewCategoryComponent} from './store/newCategory/newCategory.component'; @NgModule({ declarations: [ @@ -30,6 +31,7 @@ import {AngularFireAuthModule} from 'angularfire2/auth'; FormulaManagerComponent, HomeComponent, LoginComponent, + NewCategoryComponent, ScalePipe, AboutComponent ], @@ -54,7 +56,7 @@ import {AngularFireAuthModule} from 'angularfire2/auth'; ServiceWorkerModule.register('/ngsw-worker.js', {enabled: environment.production}) ], providers: [BreadcrumbService], - entryComponents: [LoginComponent], + entryComponents: [LoginComponent, NewCategoryComponent], bootstrap: [AppComponent] }) export class AppModule {} diff --git a/src/app/login/login.component.ts b/src/app/login/login.component.ts index 28b0040..93ea993 100644 --- a/src/app/login/login.component.ts +++ b/src/app/login/login.component.ts @@ -1,6 +1,6 @@ import {Component} from '@angular/core'; import {AngularFireAuth} from 'angularfire2/auth'; -import {MatDialog} from '../../../node_modules/@angular/material'; +import {MatDialogRef} from '../../../node_modules/@angular/material'; @Component({ selector: 'login', @@ -10,11 +10,11 @@ export class LoginComponent { email: string; password: string; - constructor(private dialog: MatDialog, private afAuth: AngularFireAuth) {} + constructor(private dialogRef: MatDialogRef, private afAuth: AngularFireAuth) {} login() { this.afAuth.auth.signInWithEmailAndPassword(this.email, this.password).then(user => { - if (user) this.dialog.closeAll(); + if (user) this.dialogRef.close(); }); } } diff --git a/src/app/store/categories.component.html b/src/app/store/categories.component.html index 6065481..41eafc2 100644 --- a/src/app/store/categories.component.html +++ b/src/app/store/categories.component.html @@ -1,6 +1,7 @@
+