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 { Component } from '@angular/core';
|
||||||
|
import { MessagingService } from './service/messaging.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
template: '<router-outlet></router-outlet>'
|
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 { CustomerGuard } from './_guards/customer.guard';
|
||||||
import { ApiService } from './providers/api-service';
|
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 { OrgGraphsService } from './providers/org-graphs.service';
|
||||||
import { CustGraphsService } from './providers/cust-graphs.service';
|
import { CustGraphsService } from './providers/cust-graphs.service';
|
||||||
import { OrgSnippetsService } from './providers/org-snippets.service';
|
import { OrgSnippetsService } from './providers/org-snippets.service';
|
||||||
|
@ -51,6 +56,8 @@ import { FilterPipeModule } from 'ngx-filter-pipe';
|
||||||
BrowserModule,
|
BrowserModule,
|
||||||
HttpClientModule,
|
HttpClientModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
|
AngularFireMessagingModule,
|
||||||
|
AngularFireModule.initializeApp(environment.firebase),
|
||||||
FilterPipeModule,
|
FilterPipeModule,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
NgxPaginationModule,
|
NgxPaginationModule,
|
||||||
|
@ -76,6 +83,8 @@ import { FilterPipeModule } from 'ngx-filter-pipe';
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
AuthGuard,
|
AuthGuard,
|
||||||
|
MessagingService,
|
||||||
|
AsyncPipe,
|
||||||
OrgGuard,
|
OrgGuard,
|
||||||
CustomerGuard,
|
CustomerGuard,
|
||||||
ApiService,
|
ApiService,
|
||||||
|
@ -92,6 +101,7 @@ import { FilterPipeModule } from 'ngx-filter-pipe';
|
||||||
],
|
],
|
||||||
bootstrap: [ AppComponent ]
|
bootstrap: [ AppComponent ]
|
||||||
})
|
})
|
||||||
|
|
||||||
export class AppModule {
|
export class AppModule {
|
||||||
constructor () {
|
constructor () {
|
||||||
if (environment.enableAnalytics) {
|
if (environment.enableAnalytics) {
|
||||||
|
|
Reference in a new issue