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

Fix(docs): Remove note about pwa-elements import not working #1586

Merged
merged 2 commits into from
May 28, 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
12 changes: 5 additions & 7 deletions site/docs-md/guides/ionic-framework-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,13 @@ Some Capacitor plugins, including the Camera, provide the web-based functionalit
npm install @ionic/pwa-elements
```

**Note:** There's currently an issue with importing the Ionic PWA elements library in an Ionic Angular app. In the meantime, include this script tag in `src/index.html`:
Import `@ionic/pwa-elements` by editing `src/main.ts`:

```html
<head>
<!-- Other tags -->
```typescript
import { defineCustomElements } from '@ionic/pwa-elements/loader';

<script type="module" src="https://unpkg.com/@ionic/pwa-elements@latest/dist/ionicpwaelements/ionicpwaelements.esm.js"></script>
<script nomodule src="https://unpkg.com/@ionic/pwa-elements@latest/dist/ionicpwaelements/ionicpwaelements.js"></script>
</head>
// Call the element loader after the platform has been bootstrapped
defineCustomElements(window);
```

With that appropriately configured now, re-run `ionic serve` and click the Camera fab button. If your computer has a webcam of any sort, a modal window displays and you can take a photo!
Expand Down