🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

angular-bootstrap-checkbox-group

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

angular-bootstrap-checkbox-group

Simple checkbox group for Angular & Bootstrap app.

0.0.3
unpublished
latest
Source
npm
Version published
Maintainers
1
Created
Source

Angular library for the simple checkbox group element(s).

NPM

Table Of Contents

Installation

npm i angular-bootstrap-checkbox-group

Example

You should have installed Bootstrap in your app and then in your module's metadata, include AngularBootstrapCheckboxGroupModule in the imports array.

import { NgModule } from '@angular/core';
import { AngularBootstrapCheckboxGroupModule } from 'angular-bootstrap-checkbox-group';

@NgModule({
  imports: [
    AngularBootstrapCheckboxGroupModule
  ]
})
<!-- some.component.html -->

<checkbox-group
  [(values)]="values"
  [options]="optionsArrayOfString"
  [disabled]="disabled"
  [titleCaseOptions]="true"
  (allState)="handleAllClick($event);"
  (getClickedOptionKeyState)="handleOptionStateChange($event.key, $event.state);"
></checkbox-group>
<h5>Pizza for delivery:</h5>
[<span *ngFor="let value of values; index as i">'{{ value }}'{{ i !== values.length - 1 ? ", " : "" }}</span>]
<button *ngIf="!disabled" (click)="disabled = !disabled" class="btn btn-secondary">Disable</button>
<button *ngIf="disabled" (click)="disabled = !disabled" class="btn btn-primary">Enable</button>
// some.component.ts

export class MyComponent {
  public disabled: boolean = false;
  public readonly values: Array<string> = [];
  public optionsArrayOfString: Array<string> = [
    "neapolitan",
    "california style",
    "chicago deep dish",
    "new york thin crust"
  ];
  public optionsTupples: Array<[string, string]> = [
    ['neapolitan', 'Neapolitan'],
    ['california style', 'California Style'],
    ['chicago deep dish', 'Chicago Deep Dish'],
    ['new york thin crust', 'New York Thin Crust']
  ];
  public optionsObject: { [key: string]: string } = {
    'neapolitan': 'Neapolitan',
    'california style': 'California Style',
    'chicago deep dish': 'Chicago Deep Dish',
    'new york thin crust': 'New York Thin Crust'
  };

  public handleAllClick = (state: boolean): void => console.log(`state: ${state}`);

  public handleOptionStateChange(key: string, state: boolean): void {
    console.log(`key: ${key} - state: ${state}`);
  }
}

Versions

This library is using Angular 8.2 and tested on the host Angular app in which Bootstrap 4.3.1 was installed.

Attribute Definition Table

Attributes for <checkbox-group></checkbox-group> element:

AttributeDecoratorTypeOptionalDefault Value
disabledInputbooleanTruefalse
valuesInputArray<string | number>Falseundefined
valuesChangeOutputEventEmitter<Array<string | number>>TrueEventEmitter instance
optionsInputArray<string | number>Falseundefined
optionsInputArray<[string | number, string | number]>Falseundefined
optionsInput{ [key: string]: string | number }Falseundefined
titleCaseOptionsInputbooleanTruefalse
allStateOutputEventEmitterTrueEventEmitter instance
getClickedOptionKeyStateOutputEventEmitter<{ key: string | number, state: boolean }>TrueEventEmitter instance

Keywords

checkbox group

FAQs

Package last updated on 25 Sep 2019

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