Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. ionic cordova plugin add cordova-fabric-plugin --variable FABRIC_API_KEY=asdjfkjasldfjklajsdfkljasldjfl--variable FABRIC_API_SECRET=asdfasdfasdfasdfasd
  2. npm install --save @ionic-native/fabric@4
  3.  
  4. import { NgModule } from '@angular/core';
  5. import { BrowserModule } from '@angular/platform-browser';
  6. import { RouteReuseStrategy } from '@angular/router';
  7.  
  8. import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
  9. import { SplashScreen } from '@ionic-native/splash-screen/ngx';
  10. import { StatusBar } from '@ionic-native/status-bar/ngx';
  11.  
  12. import { AppRoutingModule } from './app-routing.module';
  13. import { AppComponent } from './app.component';
  14.  
  15. import { DatePipe } from '@angular/common';
  16. import { Crashlytics } from '@ionic-native/fabric/';
  17.  
  18. @NgModule({
  19. declarations: [AppComponent],
  20. entryComponents: [],
  21. imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule],
  22. providers: [
  23. StatusBar,
  24. Crashlytics,
  25. DatePipe,
  26. SplashScreen,
  27. { provide: RouteReuseStrategy, useClass: IonicRouteStrategy }
  28. ],
  29. bootstrap: [AppComponent]
  30. })
  31. export class AppModule {}
  32.  
  33. import { Component } from '@angular/core';
  34. import { DatePipe } from '@angular/common';
  35. import { Crashlytics } from '@ionic-native/fabric';
  36. @Component({
  37. selector: 'app-home',
  38. templateUrl: 'home.page.html',
  39. styleUrls: ['home.page.scss']
  40. })
  41. export class Tab1Page {
  42.  
  43. constructor(public datepipe: DatePipe,
  44. private crashlytics: Crashlytics
  45. ){
  46. try {
  47. throw new Error("this is javascriptError");
  48. }
  49. catch (e) {
  50. this.crashlytics.addLog("Error while loading data");
  51. this.crashlytics.sendNonFatalCrash(e.message || e);
  52. }
  53. }
  54. myTime: String = this.datepipe.transform(new Date().toISOString(), 'hh:mm');;
  55.  
  56. myDate: String = this.datepipe.transform(new Date().toISOString(), 'MMM dd, yyyy');;
  57.  
  58. }
  59.  
  60. vendor.js:75062 Uncaught TypeError: Object(...) is not a function
  61. at vendor.js:75062
  62. at Module../node_modules/@ionic-native/fabric/index.js (vendor.js:75164)
  63. at __webpack_require__ (runtime.js:84)
  64. at Module../src/app/app.module.ts (main.js:1036)
  65. at __webpack_require__ (runtime.js:84)
  66. at Module../src/main.ts (main.js:1114)
  67. at __webpack_require__ (runtime.js:84)
  68. at Object.0 (main.js:1137)
  69. at __webpack_require__ (runtime.js:84)
  70. at checkDeferredModules (runtime.js:46)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement