import { ChangeDetectionStrategy , Component , ElementRef , IterableDiffers , forwardRef } from "@angular/core" ; import { TEMPLATED_ITEMS_COMPONENT , TemplatedItemsComponent } from "nativescript-angular/directives/templated-items-comp" ; import { isKnownView , registerElement } from "nativescript-angular/element-registry" ; import { GridView } from "../grid-view" ; @ Component ( { selector : "GridView" , template : `
        <DetachedContainer>
            <Placeholder #loader></Placeholder>
        </DetachedContainer>` , changeDetection : ChangeDetectionStrategy . OnPush , providers : [ { provide : TEMPLATED_ITEMS_COMPONENT , useExisting : forwardRef ( ( ) => GridViewComponent ) } ] } ) export class GridViewComponent extends TemplatedItemsComponent { public get nativeElement ( ) : GridView { return this . templatedItemsView ; } protected templatedItemsView : GridView ; constructor ( _elementRef , _iterableDiffers ) { super ( _elementRef , _iterableDiffers ) ; } } if ( ! isKnownView ( "GridView" ) ) { registerElement ( "GridView" , ( ) => GridView ) ; }