New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ngp-material-rating

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngp-material-rating

https://github.com/josealejandro2928/ngp-material-rating#readme

  • 1.3.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

NgpMaterialRating

Angular Library that uses material design icons for editing and showing rating variables. This library was generated with Angular CLI version 13.0.0.

Installation

npm i ngp-material-rating --save

NgpMaterialRating requires Angular Material. For angular version 8 or higher projects

ng add @angular/material

Importing the BrowserAnimationsModule into your application enables Angular's animation system. Declining this will disable most of Angular Material's animations.

Usages

You must import the module NgpMaterialRatingModule where you will use it and use the component

***
import { NgpMaterialRatingModule } from 'ngp-material-rating';
@NgModule({
  ***
  imports: [
    NgpMaterialRatingModule,
  ],
****
})

In your component:

<ngp-material-rating [value]="rating"> </ngp-material-rating>

In .ts file

export class ExampleComponent {
  rating = 4.5;
}

Image Rating

More configuration

The NgpRatingMaterialComponent component has a setting to change icon size, fill color, mode (read-only), maximum number of icons, presentation tags, and an option to put a clear button online. The interface look like this:

export interface MatStarConfig {
  size?: string;
  colorFill?: string;
  label?: string;
  readOnly?: boolean;
  showNumber?: boolean;
  showClearBtn?: boolean;
  stars?: number;
}

More examples

export class AppComponent {
  title = "ngp-material-rating-test";
  rating = 3.5;
  ratingForm = new FormControl(2.5, [Validators.required]);

  config1: MatStarConfig = {
    size: "22px",
    readOnly: true,
    colorFill: "#fa4508",
    stars: 20,
  };

  config2: MatStarConfig = {
    size: "36px",
    readOnly: false,
    showClearBtn: true,
    showNumber: true,
  };
}
<ngp-material-rating [config]="this.config1" [(ngModel)]="rating">
</ngp-material-rating>
<ngp-material-rating [config]="this.config2" [formControl]="ratingForm">
</ngp-material-rating>

Image Rating

Keywords

FAQs

Package last updated on 21 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc