Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import {NgModule, ErrorHandler} from '@angular/core';
- import {BrowserModule} from '@angular/platform-browser';
- import {IonicApp, IonicModule, IonicErrorHandler, NavController} from 'ionic-angular';
- import {MyApp} from './app.component';
- import {IonicStorageModule, Storage} from '@ionic/storage';
- import {AboutPage} from '../pages/about/about';
- import {ContactPage} from '../pages/contact/contact';
- import {HomePage} from '../pages/home/home';
- import {TabsPage} from '../pages/tabs/tabs';
- import { InAppBrowser } from '@ionic-native/in-app-browser';
- import { StatusBar } from '@ionic-native/status-bar';
- import {SplashScreen} from '@ionic-native/splash-screen';
- import {Http} from "@angular/http";
- import {AuthConfig, AuthHttp} from "angular2-jwt";
- import {AuthService} from "../providers/auth";
- import {Login} from "../pages/login/login";
- import {Costumize} from "../pages/costumize/costumize";
- import {Profile} from "../pages/profile/profile";
- import {Facebook} from "@ionic-native/facebook";
- import {Auth, User, CloudSettings, CloudModule} from "@ionic/cloud-angular";
- export function getAuthHttp(http, storage) {
- return new AuthHttp(new AuthConfig({
- globalHeaders: [{'Accept': 'application/json'}],
- tokenGetter: (() => storage.get('id_token'))
- }), http);
- }
- const cloudSettings: CloudSettings = {
- 'core': {
- 'app_id': 'xxxxxxx'
- }
- };
- @NgModule({
- declarations: [
- MyApp,
- AboutPage,
- ContactPage,
- HomePage,
- TabsPage,
- Login,
- Costumize,
- Profile
- ],
- imports: [
- BrowserModule,
- IonicModule.forRoot(MyApp),
- IonicStorageModule.forRoot(),
- CloudModule.forRoot(cloudSettings)
- ],
- bootstrap: [IonicApp],
- entryComponents: [
- MyApp,
- AboutPage,
- ContactPage,
- HomePage,
- TabsPage,
- Login,
- Costumize,
- Profile
- ],
- providers: [
- StatusBar,
- SplashScreen,
- { provide: ErrorHandler, useClass: IonicErrorHandler },
- InAppBrowser,
- Facebook,
- Auth,
- User,
- AuthService,
- {
- provide: AuthHttp,
- useFactory: getAuthHttp,
- deps: [Http, Storage]
- },
- ]
- })
- export class AppModule {
- }
Advertisement
Add Comment
Please, Sign In to add comment