Skip to main content
cngx-src documentation

CngxRatingItem

DirectivePrimaryv0.1.0WCAG AA

projects/forms/input/rating/rating-item.directive.ts

Import#

import { CngxRatingItem } from '@cngx/forms/input'

Description#

Overrides the per-star glyph rendered by CngxRating.

Apply as a structural directive on an <ng-template> inside a <cngx-rating>; the template is stamped once per star with a typed CngxRatingItemContext. Without it, the control falls back to a minimal internal glyph - the library ships no icon component.

<cngx-rating [(value)]="score">
  <ng-template cngxRatingItem let-filled="filled">
    <my-icon [name]="filled ? 'star' : 'star-outline'" />
  </ng-template>
</cngx-rating>

https://cngxjs.github.io/cngx/examples/#/forms/input/rating/basic

Metadata#

Index#

Methods#

ngTemplateContextGuard#CngxRatingItemContext
Static
ngTemplateContextGuard(_dir: CngxRatingItem, ctx: unknown)

Narrows the template's let- bindings to CngxRatingItemContext.

@param_dirCngxRatingItem
@paramctxunknown