diff --git a/packages/angular/src/lib/cdk/platform-filters/vision-filter.component.ts b/packages/angular/src/lib/cdk/platform-filters/vision-filter.component.ts new file mode 100644 index 0000000..b84bdef --- /dev/null +++ b/packages/angular/src/lib/cdk/platform-filters/vision-filter.component.ts @@ -0,0 +1,18 @@ +/* eslint-disable @angular-eslint/component-selector */ +import { Component, Inject } from '@angular/core'; +import { platformNames, IDevice } from '@nativescript/core'; +import { DEVICE } from '../../tokens'; + +@Component({ + selector: 'visionos', + template: ``, +}) +export class VisionOSFilterComponent { + public show: boolean; + + constructor(@Inject(DEVICE) device: IDevice) { + // Note: casting any to be backwards compatible + // Available in 8.6+ only + this.show = device.os === (platformNames as any).visionos; + } +} diff --git a/packages/angular/src/lib/nativescript-common.module.ts b/packages/angular/src/lib/nativescript-common.module.ts index 3bc6315..67b6b04 100644 --- a/packages/angular/src/lib/nativescript-common.module.ts +++ b/packages/angular/src/lib/nativescript-common.module.ts @@ -8,8 +8,9 @@ import { ModalDialogService } from './legacy/directives/dialogs'; import { TabViewDirective, TabViewItemDirective } from './cdk/tab-view'; import { AndroidFilterComponent } from './cdk/platform-filters/android-filter.component'; import { IOSFilterComponent } from './cdk/platform-filters/ios-filter.component'; +import { VisionOSFilterComponent } from './cdk/platform-filters/vision-filter.component'; -const CDK_COMPONENTS = [ActionBarComponent, ActionBarScope, ActionItemDirective, NavigationButtonDirective, ListViewComponent, TemplateKeyDirective, TabViewDirective, TabViewItemDirective, AndroidFilterComponent, IOSFilterComponent]; +const CDK_COMPONENTS = [ActionBarComponent, ActionBarScope, ActionItemDirective, NavigationButtonDirective, ListViewComponent, TemplateKeyDirective, TabViewDirective, TabViewItemDirective, AndroidFilterComponent, IOSFilterComponent, VisionOSFilterComponent]; registerNativeScriptViewComponents(); diff --git a/packages/angular/src/lib/public_api.ts b/packages/angular/src/lib/public_api.ts index 6aff2d9..aa008bd 100644 --- a/packages/angular/src/lib/public_api.ts +++ b/packages/angular/src/lib/public_api.ts @@ -16,6 +16,7 @@ export * from './cdk/dialog'; export * from './cdk/tab-view'; export * from './cdk/platform-filters/android-filter.component'; export * from './cdk/platform-filters/ios-filter.component'; +export * from './cdk/platform-filters/vision-filter.component'; export * from './file-system'; export * from './nativescript-common.module'; export * from './loading.service';