This should all now be using Components.
I also used embedded reference templates heavily prior to Component and had lots of rendering issues. This completely disappears with Components.
Your basically using EditForm as a supervising controller that would now render a different Component based on the deferred's results right?
Something more like this would be what you're after:
You could also just do all this in the editform.mustache like this:
I also used embedded reference templates heavily prior to Component and had lots of rendering issues. This completely disappears with Components.
Your basically using EditForm as a supervising controller that would now render a different Component based on the deferred's results right?
Something more like this would be what you're after:
- Assignments.findOne({id: options.id})
- .done(function(data){
- self.element.append(can.view.mustache("<ul>{{#each}}<li><app-engineer></app-engineer></li>{{#each}}</ul>")(data.engineers));
- })
- .fail(function(xhr){
- self.element.append(can.view.mustache("<div class='error'>Assignment not found.</div>"));
- })
You could also just do all this in the editform.mustache like this:
- <div class="assignment">
- {{#if customers}}
- <ul>
- {{#customers}}<li><app-customer></app-customer></li>{{#customers}}
- </ul>
- {{/if}}
- {{#if engineers}}
- <ul>
- {{#engineers}}<li><app-engineer></app-engineer></li>{{#engineers}}
- </ul>
- {{/if}}
- </div>
I would make EditForm a Component too under this scenario.