Skip to content

Commit 8995f89

Browse files
authored
README: Add "Example" section
1 parent d7b0a5d commit 8995f89

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,41 @@ npx tagless-ember-components-codemod
1212
```
1313

1414

15+
Example
16+
------------------------------------------------------------------------------
17+
18+
```js
19+
import Component from '@ember/component';
20+
21+
export default Component.extend({
22+
tagName: 'button',
23+
attributeBindings: ['disabled', 'disabled:aria-disabled'],
24+
classNames: ['custom-button'],
25+
classNameBindings: ['blue:blue:red'],
26+
});
27+
```
28+
29+
```hbs
30+
{{@text}}
31+
```
32+
33+
will be migrated to:
34+
35+
```js
36+
import Component from '@ember/component';
37+
38+
export default Component.extend({
39+
tagName: '',
40+
});
41+
```
42+
43+
```hbs
44+
<button disabled={{disabled}} aria-disabled={{disabled}} class="custom-button {{if this.blue "blue" "red"}}">
45+
{{@text}}
46+
</button>
47+
```
48+
49+
1550
License
1651
------------------------------------------------------------------------------
1752

0 commit comments

Comments
 (0)