aboutsummaryrefslogtreecommitdiff
path: root/vim/bundle/vim-snippets/UltiSnips/javascript-ember.snippets
blob: 1b7e7b8db04a3cd6c6e6869f0fe9183164530a90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
###################################################################
#                        Ember snippets                           #
###################################################################

priority -50

# Application
snippet eapp "App.Name = Ember.Application.create({});"
${1:App.Name} = Ember.Application.create({});
endsnippet

# Models
snippet emod "App.ModelName = Ember.Model.extend({...});"
${1:model_name} = Ember.Model.extend({
	${0://Properties here...}
});
endsnippet

# View
snippet eview "App.ViewName = Ember.Model.extend({...});"
${1:view_name} = Ember.View.extend({
	${0://Properties here...}
});
endsnippet

# Controller
snippet econtroller "App.ControllerName = Ember.Model.extend({...});"
${1:controller_name} = Ember.ObjectController.extend({
	${0://Properties here...}
});
endsnippet

# Route
snippet eroute "App.RouteName = Ember.Route.extend({...});"
${1:route_name} = Ember.Route.extend({
	${0://Properties here...}
});
endsnippet

snippet eview "App.ViewName = Ember.Model.create({...});"
${1:view_name} = Ember.View.create({
	${0://Properties here...}
});
endsnippet

# Object
snippet eobj "App.ObjectName = Ember.Object.extend({...});"
${1:object_name} = Ember.Object.create({
	${0://Properties here...}
});
endsnippet

# Mixin
snippet emix "App.MixinName = Ember.Model.extend({...});"
${1:view_name} = Ember.Mixin.create({
	${0://Properties here...}
});
endsnippet

# Ember getter and setter
snippet eget "this.get('property');"
${1:this}.get('${2:property}');
endsnippet

snippet eset "this.set('property', value);"
${1:this}.set('${2:property}', ${3:value});
endsnippet

# Computer properties
snippet cpro "property_name: function() {...}.property(),"
${1:property_name}: function() {
	${0://body...}
}.property('${3:argumenet}'),
endsnippet

snippet cpro ": function() {...}.property('property'),"
${1:property_name}: function() {
	${0://body...}
}.property(),
endsnippet


# Observes
snippet proo "property_name: function() {...}.property()"
${1:property_name}: function() {
	${0://body...}
}.observes('${3:property}'),
endsnippet

# vim:ft=snippets: