0
votes

Uncaught Error: Assertion Failed: The metamorph tags, metamorph-28-start and metamorph-28-end, have different parents. The browser has fixed your template to output valid HTML (for example, check that you have properly closed all tags and have used a TBODY tag when creating a table with '{{#each}}')

Code Snippet:

<div class="panel-body">
<div class="row">
{{#each}}
  <div class="col-xs-3">
    <label class="control-label">{{fieldname}}</label>
  </div>
  {{#if fullcolumn}}
      <div class="col-xs-9">
        <input type="text" class="form-control" placeholder="full">
      </div>
  {{else}}
      <div class="col-xs-3">
        <input type="text" class="form-control" placeholder="half">
      </div>
  {{/if}}
  {{#if newrow}} 
      </div>
      <div class="row">
  {{/if}}
{{/each}}
</div>
</div>

Guide me what i am wrong in this code?

My Requirement is:

Hi, i have the requirement to display fields details in two column table. For example

Field1   Elt1        Field2    Elt2
Field3   Elt3
Field4   Elt4        Field5    Elt5

I have array of fields,

[
  {
    "fieldname":"Field1",
    .
    .
  },
  {
    .
    .
  },
  .
  .
  .
]

How could achieve this?

2

2 Answers

2
votes
{{#if newrow}}   
      </div>  
      <div class="row">
{{/if}}

This is the problematic code. The div outside each is closed inside it.

This check was brought by this MR: https://github.com/emberjs/ember.js/pull/4404

You should not close the tag opened outside an each inside it.

1
votes

I believe the issue is from the {{#if newrow}} block. You appear to be building out the columns dynamically and trying to insert a new row. The logic on the model is not working as expected and leaving you DOM manged. Try moving to a doubly-nested {{#each}} and avoiding this switching logic.