Integrate service with app
This commit is contained in:
parent
d7adc0f514
commit
1b7146b92d
2 changed files with 23 additions and 1 deletions
|
@ -1,7 +1,19 @@
|
|||
import { Component } from '@angular/core';
|
||||
import { MessagingService } from './service/messaging.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
template: '<router-outlet></router-outlet>'
|
||||
})
|
||||
export class AppComponent { }
|
||||
export class AppComponent {
|
||||
title = 'push-notification';
|
||||
message;
|
||||
|
||||
constructor(private messagingService: MessagingService) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.messagingService.requestPermission();
|
||||
this.messagingService.receiveMessage();
|
||||
this.message = this.messagingService.currentMessage;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,11 @@ import { OrgGuard } from './_guards/org.guard';
|
|||
import { CustomerGuard } from './_guards/customer.guard';
|
||||
import { ApiService } from './providers/api-service';
|
||||
|
||||
import { AngularFireMessagingModule } from '@angular/fire/messaging';
|
||||
import { AngularFireModule } from '@angular/fire';
|
||||
import { MessagingService } from './service/messaging.service';
|
||||
import { AsyncPipe } from '../../node_modules/@angular/common';
|
||||
|
||||
import { OrgGraphsService } from './providers/org-graphs.service';
|
||||
import { CustGraphsService } from './providers/cust-graphs.service';
|
||||
import { OrgSnippetsService } from './providers/org-snippets.service';
|
||||
|
@ -51,6 +56,8 @@ import { FilterPipeModule } from 'ngx-filter-pipe';
|
|||
BrowserModule,
|
||||
HttpClientModule,
|
||||
FormsModule,
|
||||
AngularFireMessagingModule,
|
||||
AngularFireModule.initializeApp(environment.firebase),
|
||||
FilterPipeModule,
|
||||
ReactiveFormsModule,
|
||||
NgxPaginationModule,
|
||||
|
@ -76,6 +83,8 @@ import { FilterPipeModule } from 'ngx-filter-pipe';
|
|||
],
|
||||
providers: [
|
||||
AuthGuard,
|
||||
MessagingService,
|
||||
AsyncPipe,
|
||||
OrgGuard,
|
||||
CustomerGuard,
|
||||
ApiService,
|
||||
|
@ -92,6 +101,7 @@ import { FilterPipeModule } from 'ngx-filter-pipe';
|
|||
],
|
||||
bootstrap: [ AppComponent ]
|
||||
})
|
||||
|
||||
export class AppModule {
|
||||
constructor () {
|
||||
if (environment.enableAnalytics) {
|
||||
|
|
Reference in a new issue