From 2b17c1388b1c70b19aa6c3fac960bc7210bfc293 Mon Sep 17 00:00:00 2001 From: Vladimir Potekhin Date: Fri, 25 Oct 2024 16:24:54 +0300 Subject: [PATCH] chore: fix demo by adding import from platform package --- apps/demo/src/app/pages/platform/index.html | 5 +++++ apps/demo/src/app/pages/platform/index.ts | 6 +++++- libs/platform/README.md | 8 ++++++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/apps/demo/src/app/pages/platform/index.html b/apps/demo/src/app/pages/platform/index.html index cd8ca7234..37ba2d6a4 100644 --- a/apps/demo/src/app/pages/platform/index.html +++ b/apps/demo/src/app/pages/platform/index.html @@ -1 +1,6 @@ + +

+ isIos: + {{ isIos }} +

diff --git a/apps/demo/src/app/pages/platform/index.ts b/apps/demo/src/app/pages/platform/index.ts index e8443f54a..595c2406b 100644 --- a/apps/demo/src/app/pages/platform/index.ts +++ b/apps/demo/src/app/pages/platform/index.ts @@ -1,5 +1,6 @@ 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({ @@ -7,9 +8,12 @@ import {MarkdownModule} from 'ngx-markdown'; 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; diff --git a/libs/platform/README.md b/libs/platform/README.md index 6acab3975..2e730dec0 100644 --- a/libs/platform/README.md +++ b/libs/platform/README.md @@ -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`