本文整理匯總了TypeScript中@ionic/pro.Pro類的典型用法代碼示例。如果您正苦於以下問題:TypeScript Pro類的具體用法?TypeScript Pro怎麽用?TypeScript Pro使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Pro類的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: handleError
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
}
}