Skip to content

Commit

Permalink
Adding check-box component (elastic#11550)
Browse files Browse the repository at this point in the history
* Adding selectable-row component

* Adding example usage to testbed

* Using shorthand property name

* No need for transclusion

* Renaming selectable-row to check-box

* Resetting testbed code
  • Loading branch information
ycombinator authored and snide committed May 30, 2017
1 parent b4c3b25 commit c7af1f2
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ui/public/check_box/check_box.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<input
type="checkbox"
class="kuiCheckBox"
ng-click="checkBox.onSelectChange(checkBox.id, checkBox.isSelected)"
ng-model="checkBox.isSelected"
>
21 changes: 21 additions & 0 deletions src/ui/public/check_box/check_box.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { uiModules } from 'ui/modules';
import template from './check_box.html';

const app = uiModules.get('kibana');

app.directive('checkBox', function () {
return {
restrict: 'E',
replace: true,
template,
scope: {
id: '=',
isSelected: '=',
onSelectChange: '=',
},
controllerAs: 'checkBox',
bindToController: true,
controller: class CheckBoxController {
}
};
});
1 change: 1 addition & 0 deletions src/ui/public/check_box/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import './check_box';

0 comments on commit c7af1f2

Please sign in to comment.