How do I use {{#isolate}} ?
If I make a page with a bunch of templates, like:
{{> page1}}
<template name="template1">reactive source1</template>
<template name="template2">reactive source2</template>
<template name="template3">reactive source3</template>
<template name="template4">reactive source4</template>
<template name="template5">reactive source5</template>
<template name="page1">
{{> template1}}
{{> template2}}
{{> template3}}
{{> template4}}
{{> template5}}
</template>
If each single template has content that updates, will it rerender the whole page each time? How do i stop that from happening?
Should I use isolate in this situation?
If I bind any helper to these templates, like:
Template.template1.rendered = ->
console.log 'rendered at: ' + new Date().getTime()
it will render at least 5 times because I have 5 reactive sources. If each of them includes a
reactive list, it will be rendered docs.length times.
I can’t control single template instances.
Sorry about my english.
Here is an issue related to this that I’ve posted on GitHub before: https://github.com/meteor/meteor/issues/435
No, but all its parents’ rendered event will be triggered! Actually, rendered event propagate like dom events.
And when reactive data in a specific template is changed, the content of its and all its sub templates will be re-rendered! But not his parents!
Then what “constant” and “isolate” do? I think the best way to figure them out is to do some test.
Here is a simple test:
html:
js:
Use chrome’s/firebug’s console to change the session data, see what will happen. Pay attention to whether the text entered in these inputs will be cleared(means been re-rendered) when reactive changed and whether the rendered event is triggered.
……sorry about my English, too^_^