我是Meteor.js和MongoDB的新手,所以这个问题可能有一个明显的解决方案,我错过了,但到目前为止,我的搜索没有任何结果.
我的第一个Meteor项目是一个非常简单的博客.在MongoDB中,我有以下内容:
Blog.insert({
author: "Name Here",
title: "Title Here",
headerHTML: "This is my very first blog post.",
bodyHTML: "What drives us to solve these types of problems?",
date: new Date()
});
然后在blog.js我有:
if (Meteor.isClient) {
Meteor.subscribe("blog");
Template.posts.entry = function () {
return Blog.find({});
};
}
最后在我的HTML中我有以下内容
...
{{> posts}}
...
{{#each entry}}
{{author}}
{{date}}
{{title}}
{{headerHTML}}
{{bodyHTML}}
{{/each}}
当我让应用运行{{headerHTML}}和{{bodyHTML}}指定的部分时,返回文字字符串.所以你看到文本中的标签.我想要的是将字符串视为HTML并显示为这样.所以有些文字会加粗,我可以有链接等等……任何有人可以投入的智慧?
我已经尝试将把手放在各种HTML标签中(例如< p> {{bodyHML}}< / p>),但没有运气.