0

I am struggling for some time with this issue. Ember 1.12. One model passed is working fine, but another is not as it should. Here is the relevant parts from route(search.js) -

model(params) {
this.set('searchParams', params);
this.store.unloadAll('search');
this.store.unloadAll('sceneai');

return Ember.RSVP.hash({
  sceneai: this.store.findQuery('sceneai', params.q),
  searchResults: this.store.findQuery('search', params)
});
},

renderTemplate(controller, model) {
  this._super(controller,model);
  var folderController = this.controllerFor('files.folder');
  folderController.set('model', model.searchResults);

  this.render('files.folder', {
    into: 'search',
    outlet: 'results',
    controller: folderController
  });

  // Second folder controller for 'vectorResults' outlet
  let vectorFolderController = this.controllerFor('files.vector');
  vectorFolderController.set('model', model.sceneai);

  this.render('files.vector', {
    into: 'search',
    outlet: 'vectorResults',
    controller: vectorFolderController
  });

},

Then when I render in each corresponding hbs(vector.hbs and folder.hbs) the folder is working just fine but vector one isnt. I am using this in the vector.hbs that works, but it should be like it is in folder.hbs -

{{#each model.content as |item|}}
{{item._data.path}}

But this is not how it should work. It also breaks everything later in the file chain.

The one that works is folder.hbs, it has -

{{#each model |item|}}
{{item.path}}

This is img with vector model that is not working with 4 content items the other is with 2 items that is working fine -

The model that does not work properly

enter image description here

1 Answer 1

0

Nevermind. I did it by extending my sceneai model with file model. And the search model already had the File extend, thats why it worked.

Sign up to request clarification or add additional context in comments.

1 Comment

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.