Browse Source

* AngularJS

pull/154/head
RubaXa 10 years ago
parent
commit
4de9ce498d
  1. 16
      README.md

16
README.md

@ -126,8 +126,10 @@ You can also define whether lists can give away, give and keep a copy (`clone`),
### Support AngularJS ### Support AngularJS
Include [ng-sortable.js](ng-sortable.js) Include [ng-sortable.js](ng-sortable.js)
Demo: http://jsbin.com/naduvo/1/edit?html,js,output
```html ```html
<div ng-app"myApp"> <div ng-app="myApp" ng-controller="demo">
<ul ng-sortable> <ul ng-sortable>
<li ng-repeat="item in items">{{item}}</li> <li ng-repeat="item in items">{{item}}</li>
</ul> </ul>
@ -145,12 +147,12 @@ Include [ng-sortable.js](ng-sortable.js)
```js ```js
angular.module('myApp', ['ng-sortable']) angular.module('myApp', ['ng-sortable'])
.controller(function () { .controller('demo', ['$scope', function ($scope) {
this.items = ['item 1', 'item 2']; $scope.items = ['item 1', 'item 2'];
this.foo = ['foo 1', '..']; $scope.foo = ['foo 1', '..'];
this.bar = ['bar 1', '..']; $scope.bar = ['bar 1', '..'];
this.barConfig = { group: 'foobar', animation: 150 }; $scope.barConfig = { group: 'foobar', animation: 150 };
}); }]);
``` ```

Loading…
Cancel
Save