added actual basic snackbar

urls
FlayInAHook 4 years ago
parent 4a3ffc23bd
commit afe76781db

@ -51,6 +51,7 @@ import { EquipmentTypesComponent } from './pages/tables/equipment-types/equipmen
import { EngagementTypesComponent } from './pages/tables/engagement-types/engagement-types.component'; import { EngagementTypesComponent } from './pages/tables/engagement-types/engagement-types.component';
import { WorkshopsComponent } from './pages/tables/workshops/workshops.component'; import { WorkshopsComponent } from './pages/tables/workshops/workshops.component';
import { ReferenceTableComponent } from './components/reference-table/reference-table.component' import { ReferenceTableComponent } from './components/reference-table/reference-table.component'
import { MatSnackBarModule } from '@angular/material/snack-bar';
@NgModule({ @NgModule({
@ -96,6 +97,7 @@ import { ReferenceTableComponent } from './components/reference-table/reference-
MatProgressSpinnerModule, MatProgressSpinnerModule,
MatProgressBarModule, MatProgressBarModule,
MatCheckboxModule, MatCheckboxModule,
MatSnackBarModule,
GraphQLModule, GraphQLModule,
DragDropModule, DragDropModule,
MatTooltipModule, MatTooltipModule,

@ -1,3 +1,5 @@
<div (click)="testSnackBar()">
<img class="navbar-photo" src={{profileURL}}> <img class="navbar-photo" src={{profileURL}}>
<p>{{name}}</p> <p>{{name}}</p>
<p>{{email}}</p> <p>{{email}}</p>
</div>

@ -1,5 +1,6 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { AuthService } from '../../services/auth.service'; import { AuthService } from '../../services/auth.service';
import { SnackBarService } from '../../services/snackbar.service';
@Component({ @Component({
selector: 'sidenav-profile', selector: 'sidenav-profile',
@ -11,7 +12,7 @@ export class SidenavProfileComponent implements OnInit {
email: String; email: String;
profileURL: String; profileURL: String;
constructor( private auth: AuthService) { } constructor( private auth: AuthService, private snackBar: SnackBarService) { }
ngOnInit() { ngOnInit() {
this.auth.currentUser.subscribe(user => { this.auth.currentUser.subscribe(user => {
@ -23,4 +24,8 @@ export class SidenavProfileComponent implements OnInit {
} }
}); });
} }
testSnackBar(){
this.snackBar.openSnackBar("A user administration will be found here", "Ok");
}
} }

@ -5,6 +5,7 @@ import { environment } from '../../environments/environment';
import { Observable, BehaviorSubject, of } from 'rxjs'; import { Observable, BehaviorSubject, of } from 'rxjs';
import { User } from "../models/user"; import { User } from "../models/user";
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
}) })

Loading…
Cancel
Save