Giter VIP home page Giter VIP logo

maarti / angularmaterialchecklist Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 2.54 MB

Angular library available via npm that brings together several checkboxes from @angular/material to make a checklist that allows sublists.

Home Page: https://maarti.github.io/AngularMaterialChecklist

License: MIT License

JavaScript 10.34% TypeScript 74.64% HTML 9.81% CSS 5.20%
angular library material checkbox checklist nested checkboxes sublist indeterminate parent

angularmaterialchecklist's Introduction

Angular Material Checklist

mat-checklist is a npm package that brings together several checkboxes from @angular/material to make a checklist. This also allows checkboxes nesting:

Mat Checklist Demo

Getting started

Installing

  1. Install Mat-Checklist and its dependencies
npm install --save @angular/material @angular/cdk @angular/animations @maarti/mat-checklist
  1. Include a theme

In your /src/styles.css file, include one of Angular Material's prebuilt themes:

@import "~@angular/material/prebuilt-themes/indigo-pink.css";

If you are not using the Angular CLI, you can include a prebuilt theme via a <link> element in your index.html. For more information on theming and instructions on how to create a custom theme, see the theming guide.

  1. Import the component modules:
import { ChecklistModule } from '@maarti/mat-checklist';
 // ...
@NgModule({
    // ...
imports: [
    // ...
    ChecklistModule],
})

Example of use

component.html:

<mat-checklist [entries]="entries" #checklist></mat-checklist>
{{checklist.getValue() | json}}

component.ts:

import { ChecklistEntry } from '@maarti/mat-checklist';
  // ...
public entries: ChecklistEntry[] = [
  new ChecklistEntry('fruits', 'Fruits', undefined, [
    new ChecklistEntry('banana', 'Banana', false),
    new ChecklistEntry('apple', 'Apple', true),
    new ChecklistEntry('orange', 'Orange', false),
  ])];

For more examples, see the live demo.

The principle entity to pass in parameter to a checklist.

The main component. See getValue() method the get all the values of the checklist.

Running unit tests

Run ng test to execute the unit tests via Karma.

Built With

Contributing

  1. Clone the repo: git clone https://github.com/Maarti/AngularMaterialChecklist.git
  2. Install packages : npm install
  3. Add your contribution
  4. Submit a pull request

Author

Bryan MARTINET

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

angularmaterialchecklist's People

Contributors

maarti avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.