1
1
<p align =" center " >
2
- <img src =" https://raw.githubusercontent.com/Exelord/ember-snippets/master/icon.png " alt =" Ember Snippets Logo " >
2
+ <img src =" https://raw.githubusercontent.com/Exelord/ember-snippets/master/icon.png " alt =" Ember Snippets Logo " >
3
3
</p >
4
4
5
5
# ember-snippets
@@ -9,11 +9,11 @@ All-in-one snippets for Ember apps. Forget about syntax, focus on development.
9
9
Supported editors:
10
10
- vscode: https://marketplace.visualstudio.com/items?itemName=exelord.ember-snippets
11
11
12
- ** WARNING!** In most cases snippets are up-to-date which means they assumes you use latest Ember, Ember-data or any other addon with our snippets.
12
+ ** WARNING!** In most cases, snippets are up-to-date which means they assume you use the latest Ember, Ember-data or any other addon with our snippets.
13
13
14
14
## What's included?
15
15
16
- Following snippets are just a selected subset. Full list avaialble in the code: ` src/**/ `
16
+ Following snippets are just a selected subset. Full list available in the code: ` src/**/ `
17
17
18
18
### Ember Snippets
19
19
@@ -38,77 +38,77 @@ run -> run(() => { });
38
38
39
39
computed ->
40
40
computed('property', function() {
41
- // body
41
+ // body
42
42
}),
43
43
44
44
didDestroyElement ->
45
45
didInsertElement() {
46
- this._super(...arguments);
47
-
46
+ this._super(...arguments);
47
+
48
48
},
49
49
```
50
50
51
51
#### 3. Skeletons
52
- Forget about generators. Just use the skeletos for anything, eg:
52
+ Forget about generators. Just use the skeletons for anything, eg:
53
53
```
54
54
component ->
55
55
import Component from '@ember/component';
56
56
57
57
export default Component.extend({
58
- // body
58
+ // body
59
59
});
60
60
61
61
service ->
62
62
import Service from '@ember/service';
63
63
64
64
export default Service.extend({
65
- // body
65
+ // body
66
66
});
67
67
68
68
helper ->
69
69
import Helper from '@ember/component/helper';
70
70
71
71
export default Helper.extend({
72
- compute() {
73
- // body
74
- }
72
+ compute() {
73
+ // body
74
+ }
75
75
});
76
76
77
77
```
78
78
79
79
#### 4. Handlebars snippets
80
- Take the adventage of faster templating by using HBS snippets, eg:
80
+ Take the advantage of faster templating by using HBS snippets, eg:
81
81
```
82
82
yield -> {{yield}}
83
83
84
84
debugger -> {{debugger}}
85
85
86
- on -> {{on }}
86
+ on -> {{on }}
87
87
88
88
mut -> (mut )
89
89
90
90
let ->
91
- {{#let as ||}}
92
-
91
+ {{#let as ||}}
92
+
93
93
{{/let}}
94
94
95
95
if ->
96
96
{{#if }}
97
-
97
+
98
98
{{/if}}
99
99
100
100
eachelse ->
101
- {{#each as ||}}
102
-
101
+ {{#each as ||}}
102
+
103
103
{{else}}
104
-
104
+
105
105
{{/each}}
106
106
107
107
input -> <Input @value= />
108
108
109
109
linkto ->
110
110
<LinkTo @route=>
111
-
111
+
112
112
</LinkTo>
113
113
```
114
114
@@ -117,7 +117,7 @@ linkto ->
117
117
#### Ember Data
118
118
119
119
##### Imports
120
- All imports according to latest RFC: https://emberjs.github.io/rfcs/0395-ember-data-packages.html
120
+ All imports according to the latest RFC: https://emberjs.github.io/rfcs/0395-ember-data-packages.html
121
121
122
122
Examples:
123
123
@@ -192,17 +192,17 @@ task(function *() {
192
192
```
193
193
194
194
## Contribution
195
- Did I missed your favourit addon or snippet? It's super easy to contribute!
195
+ Did I miss your favorite addon or snippet? It's super easy to contribute!
196
196
197
197
1 . Create a new folder in ` src/javascript/addons ` for JS or ` src/handlebard/addons ` for HBS with you addon name, eg. ` my-addon `
198
198
2 . Create files like ` cheets.js ` , ` imports.js ` or ` skeletons.js `
199
199
3 . Fill in the files with following structure:
200
- ``` js
201
- module .exports = {
202
- " [my-addon] superFunction" : {
203
- " prefix" : " imsuperFunction" ,
204
- " body" : " import { superFunction } from 'my-addon';" ,
205
- " description" : " superFunction allows you to do super things"
206
- },
207
- }
208
- ```
200
+ ``` js
201
+ module .exports = {
202
+ " [my-addon] superFunction" : {
203
+ " prefix" : " imsuperFunction" ,
204
+ " body" : " import { superFunction } from 'my-addon';" ,
205
+ " description" : " superFunction allows you to do super things"
206
+ },
207
+ }
208
+ ```
0 commit comments