-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patha_array.coffee
More file actions
35 lines (30 loc) · 798 Bytes
/
Copy patha_array.coffee
File metadata and controls
35 lines (30 loc) · 798 Bytes
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
reactive_input =
_dep: new Deps.Dependency()
_value: {}
get: (v) ->
this._dep.depend()
this._value[v]
spush: (v, t) ->
if this._value[v] is undefined
this._value[v] = []
this._value[v].push(t)
this._value[v].map (doc, index) ->
doc.index = index
doc.index
this._dep.changed()
spop: (v, t) ->
this._value[v].splice(t, 1)
this._value[v].map (doc, index) ->
doc.index = index
doc.index
this._dep.changed()
Template.main.events
'click .add_data': (evt, t) ->
reactive_input.spush("test", {input_name: "me"})
'click .add_template': (evt, t) ->
reactive_input.spush("test1", {templatet: Template.an})
Template.main.helpers
data: ->
reactive_input.get("test")
template: ->
reactive_input.get("test1")