Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(rating): allow custom star templates #815

Merged
merged 1 commit into from
Sep 29, 2016

Conversation

maxokorokov
Copy link
Member

Part of #801

Adds a template to allow custom rating display
Default rendering still uses ★ and ☆ symbols

<template #t let-fill="fill">
  <!-- fill is a number between 0-100 to represent how the star is filled -->
</template>

<ngb-rating [(rate)]="currentRate" [starTemplate]="t"></ngb-rating>

screen shot 2016-09-29 at 00 05 32

@wesleycho
Copy link
Member

LGTM

@maxokorokov
Copy link
Member Author

Rebased

@pkozlowski-opensource
Copy link
Member

This LGTM as well. What we could / should do in a separate PR is to allow star templates as child elements of the ngb-rating:

<ngb-rating ...>
    <template>...</template>
</ngb-rating>

This is the "trick" that ngFor is using so it would be cool to support this as well. But we can totally do this in a separate PR.

@maxokorokov maxokorokov merged commit 29c44cd into ng-bootstrap:master Sep 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants