-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNOTES.txt
87 lines (50 loc) · 2.33 KB
/
NOTES.txt
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
Template inclusion tag:
{{> TEMPLATE_NAME}}
TEMPLATE_NAME komt van de html tag (<template name="myTemplate"></template>)
Block helpers:
{{#each ITEM}} DO_STUFF {{/each}}
Flow van de template
Expression:
{{MYVAR}}
property van object of return value van een template helper
Templates (html/jade files) kunnen HELPERS hebben (js/coffee)
Deze helpers bepalen de daadwerkelijke content
Syntax (coffee): Templates.MyTemplate.helpers MyVariable : MyValue
Call op de 'helpers' functie
TO CHECK:
Self-invoked / anonymous function (coffee)
Coffee: global vars with @ (collections etc)
IRONROUTER:
xyzController matcht automatisch met xyz
"Remove autopublish"
publish on server, subscribe on client
Meteor.publish(NAAM_GEVEN, FUNCTIE)
Meteor.subscribe
{{> yield}} stuurt door naar Router.route ....
Router - Doorsturen naar juiste pagina
{{>spinner}} komt van sacha:spin package (kan je gewoon gebruiken)
Dynamic routing: Router.route '/posts/:VARNAME' <-- :VARNAME stopt alles na /posts/ in
de params array onder de property 'VARNAME'
routing eigenschappen: layoutTemplate, loadingTemplate, notFoundTemplate
Tracker.autorun( DoIets(VARIABELEN) )
run 1x en daarna steeds wanneer VARIABELEN veranderen van waarde
Form submission -> .coffee kan fixen (e.preventDefault)
checken: _ library
checken: pathfor
Lokale collection (bijv errors)
Publish / subscribe kan van route afhangen (bijv alleen laden bij bepaalde /path/)
Denormalization -> sla bijv counter hard op zodat niet een hele array geladen hoeft te worden
Je kan een functie elke x seconden callen voor reactivity purposes wanneer
dit niet automatisch kan (bijv met externe api)
It’s important to note that a path of the form /:parameter? will match every possible path. Since
each route will be parsed successively to see if it matches the current path, we need to make sure
we organize our routes in order of decreasing specificity.
In other words, routes that target more specific routes like /posts/:_id should come first, and
our postsList route should be moved to the bottom of the routes group since it pretty much
matches everything, (~p.210)
PAGINATION
- Ofwel via meteor (zie commit)
- Ofwel package: meteor add percolate:paginated-subscription
https://atmospherejs.com/percolate/paginated-subscription
#counter:
# meteor add tmeasday:publish-counts HOEFT NIET