Skip to content

Commit

Permalink
chore: fix demo by adding import from platform package
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirpotekhin committed Oct 25, 2024
1 parent 6c7b4cf commit 2b17c13
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
5 changes: 5 additions & 0 deletions apps/demo/src/app/pages/platform/index.html
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
<markdown [data]="(readme | async) || ''" />

<p class="example">
<strong>isIos:</strong>
{{ isIos }}
</p>
6 changes: 5 additions & 1 deletion apps/demo/src/app/pages/platform/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
import {CommonModule} from '@angular/common';
import {ChangeDetectionStrategy, Component} from '@angular/core';
import {ChangeDetectionStrategy, Component, inject} from '@angular/core';
import {WA_IS_IOS} from '@ng-web-apis/platform';
import {MarkdownModule} from 'ngx-markdown';

@Component({
standalone: true,
selector: 'platform-page',
imports: [CommonModule, MarkdownModule],
templateUrl: './index.html',
styles: ['.example {max-inline-size: 50rem; margin: 2rem auto }'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export default class CommonPage {
protected readonly isIos = inject(WA_IS_IOS);

protected readonly readme = import(
'../../../../../../libs/platform/README.md?raw'
).then((a) => a.default.replace('![logo](logo.svg) ', '')) as any as Promise<string>;
Expand Down
8 changes: 6 additions & 2 deletions libs/platform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@
npm i @ng-web-apis/platform
```

- `isApple`
- `isIos`
## Tokens

- `WA_IS_MOBILE`
- `WA_IS_IOS`
- `WA_IS_ANDROID`
- `WA_IS_WEBKIT`

0 comments on commit 2b17c13

Please sign in to comment.