Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/87.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/.htaccess/5.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
如何将HTML5属性添加到余烬视图_Html_Ember.js - Fatal编程技术网

如何将HTML5属性添加到余烬视图

如何将HTML5属性添加到余烬视图,html,ember.js,Html,Ember.js,假设我有以下HTML代码段: <div class="content" data-section-content></div> 我想用这样的余烬视图替换它: App.ContentView = Ember.View.extend({ tagName :"div", classNames : ["content"], ... ( how can i add the >> data-section-content << to t

假设我有以下HTML代码段:

<div class="content" data-section-content></div>

我想用这样的余烬视图替换它:

App.ContentView = Ember.View.extend({
   tagName :"div",
   classNames : ["content"],
   ... ( how can i add the >> data-section-content << to the view )
});
App.ContentView=Ember.View.extend({
标记名:“div”,
类名:[“内容”],
…(我如何才能添加>>数据部分内容似乎是这样的
是相同的 作为

因此,我可以通过实施以下措施来解决问题:

App.ContentView = Ember.View.extend({
   tagName :"div",
   classNames : ["content"],
   attributeBindings : ["data-section-content"],
   "data-section-content": ""
});
或更短

App.ContentView = Ember.View.extend({
   tagName :"div data-section-content",
   classNames : ["content"]
});