|
76 | 76 | <li><a scrollto href="#directives-select2">Select2</a></li> |
77 | 77 | <li><a scrollto href="#directives-showhide">Show / Hide / Toggle</a></li> |
78 | 78 | <li><a scrollto href="#directives-tinymce">TinyMCE</a></li> |
| 79 | + <li><a scrollto href="#directives-sortable">Sortable</a></li> |
79 | 80 | <li><a scrollto href="#directives-currency">Currency</a></li> |
80 | 81 | </ul> |
81 | 82 | </li> |
@@ -967,9 +968,100 @@ <h3>How?</h3> |
967 | 968 | </div> |
968 | 969 | </div> |
969 | 970 |
|
970 | | - |
971 | 971 | </section> |
972 | 972 |
|
| 973 | + <section id="directives-sortable" ng-controller="SortableCtrl"> |
| 974 | + <div class="page-header"> |
| 975 | + <h1>Sortable</h1> |
| 976 | + </div> |
| 977 | + <div class="row"> |
| 978 | + <div class="span6"> |
| 979 | + <h3>What?</h3> |
| 980 | + |
| 981 | + <div class="row"> |
| 982 | + <div class="span3"> |
| 983 | + <p>Drag and drop the parents and children</p> |
| 984 | + <div class="well"> |
| 985 | + <h3>Destroy Families</h3> |
| 986 | + <p>You're not fit to be a mother!</p> |
| 987 | + <ul ui-sortable ng-model="parents"> |
| 988 | + <li ng-repeat="parent in parents"> |
| 989 | + <ul> |
| 990 | + <h5>{{parent.name}}</h5> |
| 991 | + <ul class="children" ui-sortable="{connectWith:'.children'}" ng-model="parent.children"> |
| 992 | + <li ng-repeat="child in parent.children">{{child}}</li> |
| 993 | + </ul> |
| 994 | + </ul> |
| 995 | + </li> |
| 996 | + </ul> |
| 997 | + </div> |
| 998 | + </div> |
| 999 | + <div class="span3"> |
| 1000 | + <pre>Parents: {{parents|json}}</pre> |
| 1001 | + </div> |
| 1002 | + </div> |
| 1003 | + </div> |
| 1004 | + <div class="span6"> |
| 1005 | + <h3>How?</h3> |
| 1006 | + <pre class="prettyprint linenums" ng-non-bindable> |
| 1007 | +<script> |
| 1008 | +$scope.parents = [ |
| 1009 | + { name: 'Anna', |
| 1010 | + children: ['Alvin', 'Becky' ,'Charlie'] }, |
| 1011 | + { name: 'Barney', |
| 1012 | + children: ['Dorothy', 'Eric'] }, |
| 1013 | + { name: 'Chris', |
| 1014 | + children: ['Frank', 'Gary', 'Henry'] } |
| 1015 | +]; |
| 1016 | +</script> |
| 1017 | + |
| 1018 | +<ul <strong>ui-sortable ng-model="parents"</strong>> |
| 1019 | + <li ng-repeat="parent in parents"> |
| 1020 | + <h3>{{parent.name}}</h3> |
| 1021 | + <ul <strong>class="children" |
| 1022 | + ui-sortable="{connectWith:'.children'}" |
| 1023 | + ng-model="parent.children"></strong> |
| 1024 | + <li ng-repeat="child in parent.children"> |
| 1025 | + {{child}} |
| 1026 | + </li> |
| 1027 | + </ul> |
| 1028 | + </li> |
| 1029 | +</ul></pre> |
| 1030 | + </div> |
| 1031 | + </div> |
| 1032 | + <div class="row"> |
| 1033 | + <div class="span6"> |
| 1034 | + <div class="row"> |
| 1035 | + <div class="span3"> |
| 1036 | + <div class="well"> |
| 1037 | + <h3>Static Items</h3> |
| 1038 | + <ul ng-model="items" ui-sortable> |
| 1039 | + <li>First</li> |
| 1040 | + <li>Second</li> |
| 1041 | + <li>Third</li> |
| 1042 | + </ul> |
| 1043 | + </div> |
| 1044 | + </div> |
| 1045 | + <div class="span3"> |
| 1046 | + <pre>Static Items: {{items|json}}</pre> |
| 1047 | + </div> |
| 1048 | + </div> |
| 1049 | + </div> |
| 1050 | + <div class="span6"> |
| 1051 | + <pre class="prettyprint linenums" ng-non-bindable> |
| 1052 | +<script> |
| 1053 | +$scope.items = ['One', 'Two', 'Three']; |
| 1054 | +</script> |
| 1055 | + |
| 1056 | +<ul ng-model="items" ui-sortable> |
| 1057 | + <li>First</li> |
| 1058 | + <li>Second</li> |
| 1059 | + <li>Third</li> |
| 1060 | +</ul></pre> |
| 1061 | + </div> |
| 1062 | + </div> |
| 1063 | + </section> |
| 1064 | + |
973 | 1065 | <section id="directives-currency" ng-controller="CurrencyCtrl"> |
974 | 1066 | <div class="page-header"> |
975 | 1067 | <h1>Currency</h1> |
|
0 commit comments