• Stars
    star
    149
  • Rank 247,848 (Top 5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 10 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A checkbox for AngularJS styled to fit the Twitter Bootstrap standard design

angular-bootstrap-checkbox

A checkbox for AngularJS styled to fit the Twitter Bootstrap standard design

Screenshot:

Screenshot

Description:

The standard checkboxes which use the input HTML element just don't look good in combination with Bootstrap.

Surprisingly, I could not find any nice looking, simple checkbox, so I built one. It is based on a button and Glyphicons which behaves like a normal checkbox.

The angular-bootstrap-checkbox is compatible to the use of the original AngularJS input[checkbox], with one minor change: while the original implementation allows an "uninitialized" or other then defined state of the model this one forces "false" or "ng-false-value" (not checked) when not set to "true" or "ng-true-value".

Installation via Bower:

$ bower install angular-bootstrap-checkbox --save

Usage:

Add "ui.checkbox" to your modules list. Then you can use it like AngularJS input[checkbox]:

<checkbox
    ng-model="checkboxModel"
    name="custom-name"              (Optional)
    ng-true-value="The Truth"       (Optional)
    ng-false-value="The Untruth"    (Optional)
    ng-change="onChange()"          (Optional)
    indeterminate="true"            (Optional)
    ng-indeterminate-value="test"   (Optional)
></checkbox>

Additionally you can set the size:

<checkbox ...></checkbox>            (Normal size, corresponds to 'btn-xs')
<checkbox large ...></checkbox>      (Large, corresponds to 'btn-sm')
<checkbox larger ...></checkbox>     (Larger, corresponds to Button default size)
<checkbox largest ...></checkbox>    (Largest, corresponds to 'btn-lg')

Screenshot

And also style the checkboxes like Bootstrap buttons:

<checkbox class="btn-primary"></checkbox>    (Looks like primary button)
<checkbox class="btn-success"></checkbox>    (Looks like success button)
<checkbox class="btn-info"></checkbox>       (Looks like info button)
<checkbox class="btn-warning"></checkbox>    (Looks like warning button)
<checkbox class="btn-danger"></checkbox>     (Looks like danger button)

Screenshot

See index.html and app.js for examples and how it works.

Testing:

Start web server e.g. via Python:

$ python -m SimpleHTTPServer 8000

Start Karma E2E tests (has to be installed globally before):

$ karma start

License

Copyright (c) 2016 Sebastian Hammerl, Getslash GmbH

Licensed under the MIT License

More Repositories

1

um34c

A small NodeJS tool to read out and control the UM34C (or UM24C / UM25C) USB analyzer via Bluetooth
JavaScript
49
star
2

sfoa

Show F*cking Outlook Appointments – A Thunderbird extension to show embedded Outlook calendar parts
JavaScript
11
star
3

power-bank-sensor-node

Tutorial how to build a USB-chargeable temperature / humidity / pressure sensor node in a power bank case which transmits the data via 433MHz to a receiver whose serial protocol is MySensor compatible.
Arduino
6
star
4

angular-bootstrap-pwgen

An animated password generator for AngularJS styled to fit the Twitter Bootstrap standard design
HTML
4
star
5

webos-app_de.omoco.paketverfolgung

webOS App – Package Tracker / Paketverfolgung (de.omoco.paketverfolgung)
JavaScript
3
star
6

angular-gsthumbnails

An image frame overlay with (popup) thumbnails on mouseover for AngularJS
JavaScript
3
star
7

webos-app_de.omoco.wikiplaces1

webOS App – Neighborhood Guide (de.omoco.wikiplaces1)
JavaScript
1
star
8

ttn_otaa_arduino_base

A base sketch for TTN experiments with Arduino
C++
1
star
9

webos-app_de.omoco.scancode

webOS App – ScanCode (de.omoco.scancode)
JavaScript
1
star
10

ssh-keydb

A tool to gather ssh public key information from servers
JavaScript
1
star
11

webos-app_de.omoco.twittertopic

webOS App – TwitterTopic (de.omoco.twittertopic)
JavaScript
1
star
12

angular-bootstrap-gsdialogs

A collection of common Bootstrap modal dialogs for AngularJS
JavaScript
1
star
13

webos-app_de.omoco.promocodes

webOS App – Promo Codes (de.omoco.promocodes)
JavaScript
1
star
14

webos-app_de.omoco.mensaplan

webOS App – Mensaplan (de.omoco.mensaplan)
JavaScript
1
star