Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/475.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Meteor.js Summernote编辑器。从数据库MongoDB读取数据_Javascript_Meteor_Meteor Blaze - Fatal编程技术网

Javascript Meteor.js Summernote编辑器。从数据库MongoDB读取数据

Javascript Meteor.js Summernote编辑器。从数据库MongoDB读取数据,javascript,meteor,meteor-blaze,Javascript,Meteor,Meteor Blaze,我在“mpowaga:autoformsummernote”中安装了“summernote:summernote”。在编辑器Summernote中输入的数据使用“SimpleSchema”写入数据集合,格式如下: content: { type: String, label: "Treść wydarzenia", autoform: { afFieldInput: { type: 'summernote',

我在“mpowaga:autoformsummernote”中安装了“summernote:summernote”。在编辑器Summernote中输入的数据使用“SimpleSchema”写入数据集合,格式如下:

content: {
      type: String,
      label: "Treść wydarzenia",
      autoform: {
        afFieldInput: {
          type: 'summernote',
          class: 'editor',
          placeholder: 'Please add content...',
          settings:{
            height: 150
          }
        }
      }
    },
这是数据库中给出的示例:

"content" : "<div>Beginning with AutoForm 4.0, there is advanced support for input types, including the ability to easily add custom input types (AKA form controls or \"widgets\"). An input type definition is essentially just a small template containing the markup plus a function that tells AutoForm how to obtain an input value from that template.</div><div><br></div><div>By default, AutoForm still automatically selects an appropriate input type based on examining the schema for each field. To override that behavior and choose your own type, you only need to add the `type` attribute to your `afFieldInput` component, or to a component that wraps an `afFieldInput` (such as `afFormGroup` or `afQuickField`), or to the `autoform` object in your schema for the field.</div><div><br></div><div>Select an input type to see all the different ways in which that type can be used in your form. Select a schema type, open your browser console, enter a value, and click Submit to see how the value of the field is converted to the proper type requested by the schema.</div>"
“内容”:“从AutoForm 4.0开始,对输入类型有高级支持,包括能够轻松添加自定义输入类型(也称为表单控件或“小部件”)。输入类型定义本质上只是一个包含标记的小模板,外加一个告诉AutoForm如何从该模板获取输入值的函数。
默认情况下,AutoForm仍然会根据检查每个字段的架构自动选择适当的输入类型。若要覆盖该行为并选择自己的类型,请您只需将`type`属性添加到`afFieldInput`组件,或添加到包装`afFieldInput`的组件(例如`afFormGroup`或`afQuickField`),或该字段的架构中的“autoform”对象。
选择一种输入类型,以查看该类型在表单中使用的所有不同方式。选择一种架构类型,打开浏览器控制台,输入一个值,然后单击“提交”,以查看如何将该字段的值转换为架构请求的正确类型。”

如何读取数据收集中的数据“内容”,以便将包含的内容显示为HTML而不是文本。

为了使其正式,我还将添加此作为答案,并引用Ronak Nagda的话:

三个大括号的模板标记{{{…}}}用于包含原始HTML 在您的页面中。您应该谨慎使用这些标签,并确保 这里的HTML内容是安全的,没有语法错误


在这种情况下,它将是
{{{wydarzenie.content}}

插入带有
html
标记和属性的数据。如果您想呈现为html,则无需执行任何操作。烘焙此类代码后:{{wydarzenie.content}在模板中,浏览器会收到这样的结果:“从AutoForm 4.0开始,对输入类型有高级支持,包括轻松添加自定义输入类型(也称为控件形式或“小部件”)的功能……”对html使用三个大括号-
{{{{wydarzenie.content}}
谢谢您的帮助。