Views are deprecated in ember js. I want to set the tagName for the application template to "empty" because I don't want my content wrapped in a div - it messes up my css. Previously I have don this by creating an views/application.js and setting tagName: ''
but views are deprecated - how can I do this without views?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
While I agree with the comments that this may not be something you want to do, you can use the ember-legacy-views addon until routable components are released.
Tagless components are also mentioned in the Component Unification RFC, which you might find interesting.
回答2:
[Reposting from this StackOverflow question]
You can control the top-level tag (even not rendering it), and its CSS classes by modifying your Ember Application as follows:
// app/app.js
App = Ember.Application.extend({
ApplicationView: Ember.Component.extend({
classNames: ['my-custom-classname'],
// Or to omit the tag entirely:
tagName: '',
}),
// ...
});
As seen in this discussion.
This does not require any hacks or a legacy plugin.