Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support to Ionic v4 in docs #1082

Merged
merged 1 commit into from
Jul 3, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion src/collections/_documentation/platforms/javascript/ionic.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,25 @@ class SentryIonicErrorHandler extends IonicErrorHandler {
}
```

Or `ErrorHandler` for Ionic v4:

```javascript
import { ErrorHandler } from '@angular/core';

import * as Sentry from 'sentry-cordova';

class SentryIonicErrorHandler extends ErrorHandler {
handleError(error) {
super.handleError(error);
try {
Sentry.captureException(error.originalError || error);
} catch (e) {
console.error(e);
}
}
}
```

Then change the `@NgModule{providers:[]}` in `app.module.ts` to:

```javascript
Expand All @@ -72,7 +91,7 @@ Then change the `@NgModule{providers:[]}` in `app.module.ts` to:
providers: [
StatusBar,
SplashScreen,
// {provide: ErrorHandler, useClass: IonicErrorHandler} remove this, add next line
// {provide: ErrorHandler, useClass: IonicErrorHandler} remove this, add next line (for Ionic 4 this line doen't exist by default)
{provide: ErrorHandler, useClass: SentryIonicErrorHandler}
]
})
Expand Down