I am new to Ember JS. I have a template using a component to render links. However, when the links are rendered, there are new lines created that throws off the page. I've tried the examples that I've found (ie - using swung dash) but nothing has worked. Here is the main template for each statement, using the entity-link component:
{{#each model as |entity|}}
<li class="entity-list-item list-group-item">
<span class="entity-primaryValue">{{entity-link entity=entity}}</span>
<span class="entity-type">({{entity.type}})</span>
</li>
{{/each}}
And here is the template of the component (called entity-link):
{{#if isPerson}}
{{link-to entity.primaryValue "people.show.basic-info" entity.id}}
{{else}}
{{link-to entity.primaryValue "entities.show" entity.type entity.id}}
{{/if}}
And here is the computed value of isPerson in the entity-link component.js file:
import Ember from 'ember';
export default Ember.Component.extend({
isPerson: Ember.computed.equal('entity.type', 'person')
});
I'm not sure what I'm doing wrong, but none of the examples I've tried have removed the new lines that are inserted. Any help would be appreciated. Thanks.
Aucun commentaire:
Enregistrer un commentaire