Skip to content

Commit 0543a48

Browse files
committed
clean up tabs in readme
1 parent 71b5bd6 commit 0543a48

File tree

1 file changed

+45
-40
lines changed

1 file changed

+45
-40
lines changed

README.md

+45-40
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Angular 1 module that integrates with Sortable.js
77

88
## Install with NPM
99

10-
npm install angular-legacy-sortablejs-maintained
10+
npm install angular-legacy-sortablejs-maintained
1111

1212
Don't install the old angular-legacy-sortablejs package as thats not maintained
1313

@@ -17,59 +17,64 @@ Don't install the old angular-legacy-sortablejs package as thats not maintained
1717

1818
```js
1919
angular.module('exampleApp', ['ng-sortable'])
20-
.component('dragAndDropExample', {
21-
template: `<ul ng-sortable>
22-
<li ng-repeat="item in ['burgers', 'chips', 'hotdog']">
23-
{$ item $}
24-
</li>
25-
</ul>`,
26-
})
20+
.component('dragAndDropExample', {
21+
template: `<ul ng-sortable>
22+
<li ng-repeat="item in ['burgers', 'chips', 'hotdog']">
23+
{$ item $}
24+
</li>
25+
</ul>`,
26+
})
2727
```
2828

2929
## Specifying a Config
3030
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)
3131

3232
```js
3333
angular.module('exampleApp', ['ng-sortable'])
34-
.component('dragAndDropExample', {
35-
template: `<ul ng-sortable=$ctrl.sortableConf>
36-
<li ng-repeat="item in ['burgers', 'chips', 'hotdog']">
37-
{$ item $}
38-
</li>
39-
</ul>`,
40-
controller: function ComponentController() {
41-
var ctrl = this;
42-
ctrl.sortableConf = {
43-
animation: 350,
44-
chosenClass: 'sortable-chosen',
45-
forceFallback: true,
46-
};
47-
},
48-
});
34+
.component('dragAndDropExample', {
35+
template: `
36+
<ul ng-sortable=$ctrl.sortableConf>
37+
<li ng-repeat="item in ['burgers', 'chips', 'hotdog']">
38+
{$ item $}
39+
</li>
40+
</ul>`,
41+
controller: class ExampleController {
42+
constructor() {
43+
this.sortableConf = {
44+
animation: 350,
45+
chosenClass: 'sortable-chosen',
46+
handle: '.grab-handle',
47+
forceFallback: true,
48+
};
49+
}
50+
},
51+
});
4952
```
5053

5154
# Drag handle
5255
Example showing how use the handle option
5356

5457
```js
5558
angular.module('exampleApp', ['ng-sortable'])
56-
.component('dragAndDropExample', {
57-
template: `<ul ng-sortable=$ctrl.sortableConf>
58-
<li ng-repeat="item in ['burgers', 'chips', 'hotdog']" draggable="false">
59-
<span class="grab-handle">Drag Header</span>
60-
<div>{$ item $}</div>
61-
</li>
62-
</ul>`,
63-
controller: function ComponentController() {
64-
var ctrl = this;
65-
ctrl.sortableConf = {
66-
animation: 350,
67-
chosenClass: 'sortable-chosen',
68-
handle: '.grab-handle',
69-
forceFallback: true,
70-
};
71-
},
72-
});
59+
.component('dragAndDropExample', {
60+
template: `
61+
<ul ng-sortable=$ctrl.sortableConf>
62+
<li ng-repeat="item in ['burgers', 'chips', 'hotdog']" draggable="false">
63+
<span class="grab-handle">Drag Header</span>
64+
<div>{$ item $}</div>
65+
</li>
66+
</ul>`,
67+
controller: class ExampleController {
68+
constructor() {
69+
this.sortableConf = {
70+
animation: 350,
71+
chosenClass: 'sortable-chosen',
72+
handle: '.grab-handle',
73+
forceFallback: true,
74+
};
75+
}
76+
},
77+
});
7378
```
7479

7580

0 commit comments

Comments
 (0)