0
模板T1有這個JS:在流星如何將數據從內部函數複製到其他模板?
if (Meteor.isClient) {
Template.t1.onRendered(function() {
var mytasks = {
tasks: [
{ text: "This is task 1" },
{ text: "This is task 2" },
{ text: "This is task 3" } ] } }) ; }
確實流星向全球提供的可變機構,讓我的 當地mytasks變量拷貝到一個全局變量或以某種方式與其他 模板分享嗎?