|
14 | 14 | <script src="../bower_components/bootstrap-select/bootstrap-select.js"></script>
|
15 | 15 | <script src="../bower_components/angular/angular.js"></script>
|
16 | 16 |
|
17 |
| - <script src="../build/angular-bootstrap-select.js"></script> |
| 17 | + <script src="../src/angular-bootstrap-select.js"></script> |
18 | 18 |
|
19 | 19 | <script src="marked.js"></script>
|
20 | 20 | <script src="selectDemo.js"></script>
|
|
25 | 25 | <section id="directives-bootstrap-select" ng-controller="SelectCtrl">
|
26 | 26 | <div class="page-header">
|
27 | 27 | <h1>Angular bootstrap-select</h1>
|
28 |
| - <code>Form: {{form || 'undefined'}}</code><br> |
29 |
| - <code>Color: {{color || 'undefined'}}</code> |
| 28 | + <code>foo: {{formData.foo || 'undefined'}}</code><br> |
| 29 | + <code>color: {{formData.color || 'undefined'}}</code><br> |
| 30 | + <code>Form1.$dirty: {{form1.$dirty | json}}</code><br> |
| 31 | + <code>Form1.$pristine: {{form1.$pristine | json}}</code><br> |
| 32 | + <code>Form1.field1.$dirty: {{form1.field1.$dirty | json}}</code><br> |
| 33 | + <code>Form1.field1.$invalid: {{form1.field1.$invalid | json}}</code><br> |
| 34 | + <code>Form1.field1.$valid: {{form1.field1.$valid | json}}</code><br> |
| 35 | + <code>Form1.field1.$viewValue: {{form1.field1.$viewValue | json}}</code><br> |
| 36 | + <code>Form1.field1.$modelValue: {{form1.field1.$modelValue | json}}</code><br> |
| 37 | + <code>Form1.field1.$error: {{form1.field1.$error | json}}</code><br> |
| 38 | + <code>Form1.field2: {{form1.field2.$error | json}}</code><br> |
30 | 39 | </div>
|
31 |
| - |
32 |
| - <select toggle selectpicker ng-model="form"> |
| 40 | + <select toggle selectpicker ng-hide="true" ng-model="teste"> |
| 41 | + <option value="">Select one</option> |
33 | 42 | <option>Mustard</option>
|
34 | 43 | <option>Ketchup</option>
|
35 | 44 | <option>Relish</option>
|
36 | 45 | </select>
|
37 |
| - |
38 |
| - <select ng-model="form" class="dropup" toggle selectpicker="{ dropupAuto: false }"> |
39 |
| - <option>Mustard</option> |
40 |
| - <option>Ketchup</option> |
41 |
| - <option>Relish</option> |
42 |
| - </select> |
43 |
| - |
44 |
| - <select toggle selectpicker ng-model="color" class="" ng-options="color.name for color in colors"></select> |
| 46 | + <form name="form1" ng-submit="submit()" novalidate> |
| 47 | + <select name="field1" ng-model="formData.foo" toggle selectpicker="{}" ng-required="true"> |
| 48 | + <option value="">Select one</option> |
| 49 | + <option>Mustard</option> |
| 50 | + <option>Ketchup</option> |
| 51 | + <option>Relish</option> |
| 52 | + </select> |
| 53 | + |
| 54 | + <select name="field2" ng-model="formData.foo" class="dropup" toggle selectpicker="{ dropupAuto: false }" ng-required="false"> |
| 55 | + <option value="">Select one</option> |
| 56 | + <option>Mustard</option> |
| 57 | + <option>Ketchup</option> |
| 58 | + <option>Relish</option> |
| 59 | + </select> |
| 60 | + |
| 61 | + <select name="field3" toggle ng-model="formData.color.name" selectpicker class="" ng-options="color.name as color.name for color in colors"> |
| 62 | + <option value="">Select one</option> |
| 63 | + </select> |
| 64 | + |
| 65 | + <select name="field4" toggle ng-model="formData.color.name" selectpicker class="" ng-options="color.name as color.name for color in colors"> |
| 66 | + <option value="">Select one</option> |
| 67 | + </select> |
| 68 | + |
| 69 | + <button type="submit">Submit</button> |
| 70 | + </form> |
45 | 71 |
|
46 | 72 | </section>
|
47 | 73 |
|
@@ -73,20 +99,20 @@ <h2>README.md</h2>
|
73 | 99 | ### Html snippet
|
74 | 100 |
|
75 | 101 | ```html
|
76 |
| -<script src="../bower_components/angular-bootstrap-select/build/angular-bootstrap-select.min.js"></script> |
| 102 | +<script src="../bower_components/angular-bootstrap-select/build/angular-bootstrap-select.min.js"></script> |
77 | 103 |
|
78 |
| -<select class="selectpicker"> |
79 |
| - <option>Mustard</option> |
80 |
| - <option>Ketchup</option> |
81 |
| - <option>Relish</option> |
82 |
| -</select> |
| 104 | +<select class="selectpicker"> |
| 105 | + <option>Mustard</option> |
| 106 | + <option>Ketchup</option> |
| 107 | + <option>Relish</option> |
| 108 | +</select> |
83 | 109 | ```
|
84 | 110 |
|
85 | 111 | ## TODO
|
86 | 112 |
|
87 | 113 | Implement ngOptions with selectpicker
|
88 | 114 | ```html
|
89 |
| -<select ng-model="form" class="selectpicker" ng-options="color.name for color in colors"></select> |
| 115 | +<select ng-model="form" class="selectpicker" ng-options="color.name for color in colors"></select> |
90 | 116 | ```
|
91 | 117 |
|
92 | 118 | ## Testing
|
|
0 commit comments