本文整理汇总了TypeScript中@ionic/pro.Pro.init方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Pro.init方法的具体用法?TypeScript Pro.init怎么用?TypeScript Pro.init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@ionic/pro.Pro
的用法示例。
在下文中一共展示了Pro.init方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: constructor
import { BrowserModule } from '@angular/platform-browser';
import { ErrorHandler, NgModule, Injectable, Injector } from '@angular/core';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { SplashScreen } from '@ionic-native/splash-screen';
import { StatusBar } from '@ionic-native/status-bar';
import { Pro } from '@ionic/pro';
import { MyApp } from './app.component';
import { HomePage } from '../pages/home/home';
Pro.init('2066f7b9', {
appVersion: '0.0.1'
})
@Injectable()
export class MyErrorHandler implements ErrorHandler {
ionicErrorHandler: IonicErrorHandler;
constructor(injector: Injector) {
try {
this.ionicErrorHandler = injector.get(IonicErrorHandler);
// alert("constructor try");
} catch(e) {
//alert("error:"+e);
// Unable to get the IonicErrorHandler provider, ensure
// IonicErrorHandler has been added to the providers list below
}
}
handleError(err: any): void {
//alert("err:"+err);
Pro.monitoring.handleNewError(err);
// Remove this if you want to disable Ionic's auto exception handling
示例2: constructor
import { BrowserModule } from '@angular/platform-browser';
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
import { MyApp } from './app.component';
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 { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
// set my app Id
Pro.init("31e1854a", {
appVersion: "0.0.1"
})
@Injectable()
export class MyErrorHandler implements ErrorHandler {
ionicErrorHandler: IonicErrorHandler;
constructor(injector: Injector) {
try {
this.ionicErrorHandler = injector.get(IonicErrorHandler);
} catch(e) {
console.error("unable to get the IonicErrorHandler provider, ensure");
console.error("IonicErrorHandler has been added to the providers list below!");
}
}
示例3:
import { ErrorHandler, NgModule } from '@angular/core';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { SplashScreen } from '@ionic-native/splash-screen';
import { StatusBar } from '@ionic-native/status-bar';
import { MyApp } from './app.component';
import { HomePage } from '../pages/home/home';
import { HomeProvider } from '../providers/home/home';
import { HttpModule, JsonpModule } from '@angular/http';
import { HttpClientModule } from '@angular/common/http';
Pro.init('8bd4c1dd', {
appVersion: '0.0.1'
});
@NgModule({
declarations: [
MyApp,
HomePage,
],
imports: [
BrowserModule,
HttpModule,
JsonpModule,
HttpClientModule,
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
示例4:
import { BrowserModule } from '@angular/platform-browser';
import { Pro } from '@ionic/pro';
import { ErrorHandler, NgModule } from '@angular/core';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { SplashScreen } from '@ionic-native/splash-screen';
import { StatusBar } from '@ionic-native/status-bar';
import { ScreenOrientation } from '@ionic-native/screen-orientation';
import { MyApp } from './app.component';
import { BookPage } from '../pages/book/book';
import { TocPage } from '../pages/toc/toc';
import { SettingsPage } from '../pages/settings/settings';
Pro.init('f9f2f3cc', {
appVersion: '1.0'
})
@NgModule({
declarations: [
MyApp,
BookPage,
TocPage,
SettingsPage
],
imports: [
BrowserModule,
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
示例5:
import { ErrorHandler, NgModule } from '@angular/core';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { SplashScreen } from '@ionic-native/splash-screen';
import { StatusBar } from '@ionic-native/status-bar';
import { InAppBrowser } from '@ionic-native/in-app-browser';
import { MomentModule } from 'angular2-moment';
import { MyApp } from './app.component';
import { SharedModule } from './shared.module';
import { GreybackProvider } from '../providers/greyback/greyback';
import { AudioProvider } from '../providers/audio/audio';
import { HttpClientModule } from '@angular/common/http';
import { Pro } from '@ionic/pro';
const IonicPro = Pro.init('2191a4b0', {
appVersion: "1.0.0"
});
export class MyErrorHandler implements ErrorHandler {
handleError(err: any): void {
IonicPro.monitoring.handleNewError(err);
}
}
@NgModule({
declarations: [
MyApp
],
imports: [
BrowserModule,
HttpModule,
IonicModule.forRoot(MyApp, {
mode: 'ios'
示例6: constructor
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { SplashScreen } from '@ionic-native/splash-screen';
import { StatusBar } from '@ionic-native/status-bar';
import { MyApp } from './app.component';
import { HomePage } from '../pages/home/home';
import { ArchivedTodosPage } from '../pages/archived-todos/archived-todos';
import { TodoProvider } from '../providers/todo/todo';
import { HttpModule } from '@angular/http';
import { HttpClientModule } from '@angular/common/http';
import { Pro } from '@ionic/pro';
import { Injectable, Injector } from '@angular/core';
Pro.init('dc972ad6', {
appVersion: '0.0.1'
})
@Injectable()
export class MyErrorHandler implements ErrorHandler {
ionicErrorHandler: IonicErrorHandler;
constructor(injector: Injector) {
try {
this.ionicErrorHandler = injector.get(IonicErrorHandler);
} catch(e) {
// Unable to get the IonicErrorHandler provider, ensure
// IonicErrorHandler has been added to the providers list below
}
}