JSPM

ngx-material-rating

2.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 125
  • Score
    100M100P100Q78342F
  • License MIT

A Material Design rating component

Package Exports

  • ngx-material-rating

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ngx-material-rating) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ngx-material-rating

A Material Design rating component

Installation

Add the package to your application.

npm install --save ngx-material-rating

Demo

https://stackblitz.com/edit/ngx-material-rating-demo

Getting started

Import the range module to your application module.

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { NgxMaterialRatingModule } from 'ngx-material-rating';

import { AppComponent } from './app.component';

@NgModule({
  declarations: [AppComponent],
  imports: [
    BrowserModule,
    FormsModule,
    NgxMaterialRatingModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Using the component

Add the component to your template and use the provided properties to suit your needs:

  • color: one of the valid value of ThemePalette
  • disabled: to disable the component
  • dense: to have less margin between stars
  • value: the rating value, can be used with [(ngModel)]
  • max: the maximum rating value

Check the demo for more examples.