summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoristeven <isteven@server.fake>2014-03-28 09:56:49 +0800
committeristeven <isteven@server.fake>2014-03-28 09:56:49 +0800
commita142175ed225e8fdcd3d0cea3c6286ceaec97623 (patch)
treef71acc86a726e70de692a330530047e636927a2f
parentc50f0fef14ef53b2e9c2af706f2a9d1e15b28c34 (diff)
downloadangular-multi-select-a142175ed225e8fdcd3d0cea3c6286ceaec97623.zip
angular-multi-select-a142175ed225e8fdcd3d0cea3c6286ceaec97623.tar.gz
angular-multi-select-a142175ed225e8fdcd3d0cea3c6286ceaec97623.tar.bz2
README.md re-formatting :p
-rw-r--r--README.md32
-rw-r--r--multiselect.htm24
2 files changed, 27 insertions, 29 deletions
diff --git a/README.md b/README.md
index a17ab2c..71d3c1d 100644
--- a/README.md
+++ b/README.md
@@ -41,51 +41,49 @@ Attributes / Options
--
Below are the available attributes to configure the multi-select directive:
-#### input-model (REQUIRED)
+##### input-model (REQUIRED)
$scope variable. Array of objects.
<br />Example:
<br />$scope.inputList = [
-<br />&nbsp;&nbsp;&nbsp;&nbsp;{ id: 1, firstName: "Peter", lastName: "Parker", selected: false },
+&nbsp;&nbsp;&nbsp;&nbsp;{ id: 1, firstName: "Peter", lastName: "Parker", selected: false },
<br />&nbsp;&nbsp;&nbsp;&nbsp;{ id: 2, firstName: "Mary", lastName: "Jane", selected: false },
<br />&nbsp;&nbsp;&nbsp;&nbsp;{ id: 3, firstName: "Bruce", lastName: "Wayne", selected: true },
<br />&nbsp;&nbsp;&nbsp;&nbsp;{ id: 4, firstName: "David", lastName: "Banner", selected: false },
<br />&nbsp;&nbsp;&nbsp;&nbsp;{ id: 5, firstName: "Natalia", lastName: "Romanova", selected: false },
<br />&nbsp;&nbsp;&nbsp;&nbsp;{ id: 6, firstName: "Clark", lastName: "Kent", selected: true }
-<br />];
+];
- #### item-label (REQUIRED)
+##### item-label (REQUIRED)
input-model property that you want to display on the button & checkboxes. Separate multiple values by space.
<br />Example:
item-label="firstName lastName"
-
- #### tick-property (REQUIRED):
+##### tick-property (REQUIRED):
input-model property with a boolean value that represent the state of a checkbox.
<br />For example:
- item-ticker is "selected"
- - if selected === true, checkbox will be ticked.
-<br />If selected === false, checkbox will not be ticked.
+ - if selected === true, checkbox will be ticked.
+ - If selected === false, checkbox will not be ticked.
- item-ticker is "isOn"
- if isOn === true, checkbox will be ticked.
-<br />If isOn === false, checkbox will not be ticked.
-
+ - If isOn === false, checkbox will not be ticked.
- #### output-model:
+##### output-model:
A $scope variable. If specified, will list all the selected checkboxes model.
-- #### orientation ( "vertical" | "horizontal" )
+##### orientation ( "vertical" | "horizontal" )
Orientation of the list of checkboxes. If not specified, the default will be "vertical".
-- #### max-labels
+##### max-labels
Maximum number of items that will be displayed in the dropdown button. If not specified, will display all selected items.
-<br />Example: "2"
-<br />Using the input-model above, then button will display the first two selected items: "Mary Jane, Luke Skywalker, ..."
+<br />Example: "1"
+<br />- Using the input-model above, then button will display: "Bruce Wayne, ... [ Selected: 2 ]"
-- #### max-height
+##### max-height
Maximum height of the list of checkboxes in pixels. Will show scrollbar on overflow.
<br />Example: "100".
-- #### is-disabled
+##### is-disabled
Expression to be evaluated. Will disable or enable the checkboxes.
<br />If not specified, the default will be "false".
<br />(Similar with ng-disabled, see http://docs.angularjs.org/api/ng/directive/ngDisabled)
diff --git a/multiselect.htm b/multiselect.htm
index 23d08a9..a05f684 100644
--- a/multiselect.htm
+++ b/multiselect.htm
@@ -76,12 +76,12 @@ myApp.controller( 'main' , [ '$scope' , function ($scope) {
/////////////
$scope.minData = [
- { id: 1, firstName: "Peter", lastName: "Parker", selected: false, hoho:'hoho' },
- { id: 2, firstName: "Mary", lastName: "Jane", selected: false, hoho:'hoho' },
- { id: 3, firstName: "Bruce", lastName: "Wayne", selected: true, hoho:'hoho' },
- { id: 4, firstName: "David", lastName: "Banner", selected: false, hoho:'hoho' },
- { id: 5, firstName: "Natalia", lastName: "Romanova", selected: false, hoho:'hoho' },
- { id: 6, firstName: "Clark", lastName: "Kent", selected: true, hoho:'hoho' },
+ { id: 1, firstName: "Peter", lastName: "Parker", selected: false },
+ { id: 2, firstName: "Mary", lastName: "Jane", selected: false },
+ { id: 3, firstName: "Bruce", lastName: "Wayne", selected: true, },
+ { id: 4, firstName: "David", lastName: "Banner", selected: false },
+ { id: 5, firstName: "Natalia", lastName: "Romanova", selected: false },
+ { id: 6, firstName: "Clark", lastName: "Kent", selected: true },
];
// Open your console and watch minData changes
@@ -102,12 +102,12 @@ myApp.controller( 'main' , [ '$scope' , function ($scope) {
// Data. For the sake of testing, this time around we try to use 'checked' to hold checkbox state.
$scope.fullData = [
- { id: 1, firstName: "Tom", lastName: "Cruise", checked: true, yeye:'yeye' },
- { id: 2, firstName: "Brad", lastName: "Pitt", checked: false, yeye:'yeye' },
- { id: 3, firstName: "Angelina", lastName: "Jolie", checked: false, yeye:'yeye' },
- { id: 4, firstName: "Scarlett", lastName: "Johansson", checked: false, yeye:'yeye' },
- { id: 5, firstName: "Gerard", lastName: "Buttler", checked: true, yeye:'yeye' },
- { id: 6, firstName: "Leonardo", lastName: "DiCaprio", checked: false, yeye:'yeye' },
+ { id: 1, firstName: "Tom", lastName: "Cruise", checked: true },
+ { id: 2, firstName: "Brad", lastName: "Pitt", checked: false },
+ { id: 3, firstName: "Angelina", lastName: "Jolie", checked: false },
+ { id: 4, firstName: "Scarlett", lastName: "Johansson", checked: false },
+ { id: 5, firstName: "Gerard", lastName: "Buttler", checked: true },
+ { id: 6, firstName: "Leonardo", lastName: "DiCaprio", checked: false },
];
// Open your console and watch fullData changes