Skip to content

Commit 8e2f1c9

Browse files
committed
add example index page for testing plus update README
1 parent de92361 commit 8e2f1c9

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Don't install the old angular-legacy-sortablejs package as thats not maintained
1717
## Simple Drag and Drop
1818

1919
```js
20-
angular.module('exampleApp', [])
20+
angular.module('exampleApp', ['ng-sortable'])
2121
.component('dragAndDropExample', {
2222
template: `<ul ng-sortable>
2323
<li ng-repeat="item in ['burgers', 'chips', 'hotdog']">
@@ -31,7 +31,7 @@ angular.module('exampleApp', [])
3131
You can pass a Config obj to `ng-sortable` and it will pass this onto the created sortable object. The available options can be found [here](https://github.com/RubaXa/Sortable#options)
3232

3333
```js
34-
angular.module('exampleApp', [])
34+
angular.module('exampleApp', ['ng-sortable'])
3535
.component('dragAndDropExample', {
3636
template: `<ul ng-sortable=$ctrl.sortableConf>
3737
<li ng-repeat="item in ['burgers', 'chips', 'hotdog']">
@@ -53,7 +53,7 @@ angular.module('exampleApp', [])
5353
Example showing how use the handle option
5454

5555
```js
56-
angular.module('exampleApp', [])
56+
angular.module('exampleApp', ['ng-sortable'])
5757
.component('dragAndDropExample', {
5858
template: `<ul ng-sortable=$ctrl.sortableConf>
5959
<li ng-repeat="item in ['burgers', 'chips', 'hotdog']" draggable="false">

example/angular-legacy-sortable.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../angular-legacy-sortable.js

example/index.html

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!doctype html>
2+
<html ng-app="exampleApp">
3+
<head>
4+
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.3/angular.min.js"></script>
5+
<script src="//rubaxa.github.io/Sortable/Sortable.js"></script>
6+
<script src="./angular-legacy-sortable.js"></script>
7+
8+
<script>
9+
angular.module('exampleApp', ['ng-sortable'])
10+
.component('dragAndDropExample', {
11+
template: `<ul ng-sortable>
12+
<li ng-repeat="item in ['burgers', 'chips', 'hotdog']">
13+
{{ item }}
14+
</li>
15+
</ul>`,
16+
})
17+
</script>
18+
19+
</head>
20+
<body >
21+
<drag-and-drop-example></drag-and-drop-example>
22+
</body>
23+
</html>

0 commit comments

Comments
 (0)