src/app/app.component.ts
| templateUrl | app.html |
Properties |
|
constructor(platform: Platform, menu: MenuController, statusBar: StatusBar, splashScreen: SplashScreen, config: Config, navProxy: NavProxyService, alertCtrl: AlertController, msgService: MessagingService, chatManager: ChatManager)
|
||||||||||||||||||||||||||||||||||||||||
|
Defined in src/app/app.component.ts:26
|
||||||||||||||||||||||||||||||||||||||||
|
1 - init firebase 2 - quando
Parameters :
|
| Public alertCtrl |
alertCtrl:
|
Type : AlertController
|
|
Defined in src/app/app.component.ts:47
|
| Public chatManager |
chatManager:
|
Type : ChatManager
|
|
Defined in src/app/app.component.ts:49
|
| Public config |
config:
|
Type : Config
|
|
Defined in src/app/app.component.ts:45
|
| detailNav |
detailNav:
|
Type : Nav
|
Decorators : ViewChild
|
|
Defined in src/app/app.component.ts:19
|
| detailPage |
detailPage:
|
Type : any
|
Default value : null
|
|
Defined in src/app/app.component.ts:23
|
| masterNav |
masterNav:
|
Type : Nav
|
Decorators : ViewChild
|
|
Defined in src/app/app.component.ts:20
|
| masterPage |
masterPage:
|
Type : any
|
Default value : null
|
|
Defined in src/app/app.component.ts:22
|
| Public menu |
menu:
|
Type : MenuController
|
|
Defined in src/app/app.component.ts:42
|
| Public msgService |
msgService:
|
Type : MessagingService
|
|
Defined in src/app/app.component.ts:48
|
| pages |
pages:
|
Type : Array<literal type>
|
|
Defined in src/app/app.component.ts:26
|
| Public platform |
platform:
|
Type : Platform
|
|
Defined in src/app/app.component.ts:41
|
| Public splashScreen |
splashScreen:
|
Type : SplashScreen
|
|
Defined in src/app/app.component.ts:44
|
| Public statusBar |
statusBar:
|
Type : StatusBar
|
|
Defined in src/app/app.component.ts:43
|
| Public user |
user:
|
Type : any
|
|
Defined in src/app/app.component.ts:25
|
| Public zone |
zone:
|
Type : NgZone
|
|
Defined in src/app/app.component.ts:24
|
import { Component, ViewChild, NgZone } from '@angular/core';
import { Platform, MenuController, Nav, AlertController } from 'ionic-angular';
import * as firebase from 'firebase/app';
import { ListaConversazioniPage } from '../pages/lista-conversazioni/lista-conversazioni';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import { Config } from 'ionic-angular';
import {NavProxyService} from '../providers/nav-proxy';
//import {PlaceholderPage} from '../pages/placeholder/placeholder';
import { MessagingService } from '../providers/messaging-service';
import { ChatManager } from '../providers/chat-manager/chat-manager';
@Component({
templateUrl: 'app.html'
})
export class MyApp {
// Grab References to our 2 NavControllers...
@ViewChild('detailNav') detailNav: Nav;
@ViewChild('masterNav') masterNav: Nav;
// Empty placeholders for the 'master/detail' pages...
masterPage: any = null;
detailPage: any = null;
public zone:NgZone;
public user:any;
pages: Array<{title: string, component: any}>;
/**
* 1 - init firebase
* 2 - quando
* @param platform
* @param menu
* @param statusBar
* @param splashScreen
* @param config
* @param navProxy
* @param alertCtrl
* @param msgService
* @param chatManager
*/
constructor(
public platform: Platform,
public menu: MenuController,
public statusBar: StatusBar,
public splashScreen: SplashScreen,
public config: Config,
private navProxy: NavProxyService,
public alertCtrl: AlertController,
public msgService: MessagingService,
public chatManager: ChatManager
) {
this.zone = new NgZone({});
firebase.initializeApp(config.get("firebaseConfig"));
platform.ready().then(() => {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
statusBar.styleDefault();
splashScreen.hide();
// alert(" navProxy.masterNav: ");
// Add our nav controllers to
// the nav proxy service...
navProxy.masterNav = this.masterNav;
navProxy.detailNav = this.detailNav;
this.masterNav.setRoot(ListaConversazioniPage, { detailNavCtrl: this.detailNav });
// this.detailNav.setRoot(PlaceholderPage);
this.msgService.initMessage();
this.msgService.getPermission();
// set tenant
let appConfig = config.get("appConfig");
const tenant = appConfig.tenant;
// init chat manager
this.chatManager.configureWithAppId(tenant);
});
}
}
<!--<ion-split-pane>
<ion-nav [root]="rootPage" #content main swipeBackEnabled="false"></ion-nav>
<ion-menu [content]="content">
<ion-header>
<ion-toolbar>
<ion-title>Pages</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-list>
<button ion-item *ngFor="let p of pages" (click)="openPage(p)">
{{p.title}}
</button>
</ion-list>
</ion-content>
</ion-menu>
<ion-nav [root]="rootPage" #content main swipeBackEnabled="false"></ion-nav>
</ion-split-pane>-->
<ion-split-pane (ionChange)="navProxy.onSplitPaneChanged($event._visible);">
<ion-nav [root]="masterPage" #masterNav></ion-nav>
<ion-nav [root]="detailPage" #detailNav main></ion-nav>
</ion-split-pane>