blueFast
blueFast

Reputation: 44371

Is class="ember-view" important?

I have seen that forcing a class on the render helper will make ember forget about the standard ember-view class. For example:

{{render "userinfo"}}

Generates:

<div id="ember1097" class="ember-view">

But:

{{render "userinfo" class="xxx"}}

Will generate:

<div id="ember1097" class="xxx">

I guess the same will happen with the view helper.

What effect does this have? Is ember-view not really needed? Why is it used then? Or must I take care to include ember-view in my forced class? like:

{{render "userinfo" class="xxx ember-view"}}

Upvotes: 3

Views: 840

Answers (2)

Miguel Madero
Miguel Madero

Reputation: 1948

You can safely ignore the class. Now {{render}} shouldn't add an extra element. What version of ember are you using? It seems to me that's an old one. I think views generate a div, but I had a quick look at an app and it doesn't generate a wrapper element.

In either case, for what I remember the class is there so you can style it or use it in your own code, but you can safely ignore it.

Upvotes: 0

Jake Haller-Roby
Jake Haller-Roby

Reputation: 6427

This are auto-generated classes/ids provided by ember that help to manage ember states and views. Unless you are planning to fork the ember.js git and modify it in some way, you can simply ignore these class and id generated values (neither manually add or remove them).

Upvotes: 1

Related Questions