好的,所以我不确定为什么我不能渲染代码。首先,如果我 console.log users.content 我得到了我想要的内容,但我有些无法将它传递给 textarea 以便它显示它......
Users = new Meteor.Collection("users");
if(Meteor.is_client){
Template.inputUser.code = function(){
var el = Users.find({name:"oscar"});
el.forEach(function(users){
console.log(users.content);
})
}
}
然后在我的html模板上我有
<body>{{> inputUser}}</body>
<template name="inputUser">
<textarea>{{content}}</textarea>
</template>
而且我会在分贝上记录下来
if(Meteor.is_server)
Users.insert({name:"oscar",content:"hello world"})
谢谢你们的帮助。