ember.js - How to populate nested views/controllers? -


I am trying to create an amber app with nested scenes. I want to (basically) three vertical columns, the left-most containing containing the list of environments. Clicking on the environment will populate the second (center) column with the jobs related to the environment, and then when clicking on the job in the second column, it populates the third column with different details depending on the job.

The data is coming from an ARPM through active modal serials, as is the need to embed the necessary ID

So far, I have the following routes:

  Skill. Router.map () - & gt; this. Source 'atmosphere', - & gt; this. Resource 'Environment', {Path: ": Environment_ID"}, - & gt; this. Source 'Jobs' Skills. Index root = amber way. Extension Redirected: - & gt; this. Transcision 'atmosphere' skills Ambient Path = Amber way. Advanced Setup Controller: (Controller) - & gt;  

My Handler Application Template:

  & lt; Div class = "container" & gt; & Lt; Div class = "row" & gt; {{Outlet}} & lt; / Div & gt; & Lt; / Div & gt;  

Environment template

  & lt; Div id = "environments" class = "col-sm-4" & gt; {{#each}} {{Visual skills. Environmental Environment}} {{/ each}} < / Div & gt; & Lt; Div class = "col-sm-8" & gt; {{Outlet}} & lt; / Div & gt;  

View environment:

  Skill. Environmental Environment = Ember.View.extend templateName: Click 'Environment': - & gt; #What am I trying to update the job controller here?  

Environment Control:

  Skill. Ambient Controller = Ember.ArrayController  

Model:

  Skill. Environment = DS.Model.extend Title: DS.attr ('string') Description: DS.attr ('string') Jobs: DS.hasMany ('job') skills. Job = DS Models. Andand Title: DS.ETR ('String') Environment: DS.Belongsanto ('Environment')  

This will display and display the environment in the first column.

Edit : It seems compulsive that what I am doing after that, but I do not know how I know the model of a controller / material property To bind property?

What you should do is generate the list of environments in the environment template (environment not index template). When an environment is selected from this list, then it should be changed in the environment. Show route should show the list of jobs for that environment in the Environmental Resource Path. This environment should be presented in the template environment template. Then the job selection will turn into a job under the job resource.

The main thing is that the top level resource route will be maintained and the subsequent child trails will be provided in it, the resource will be preserved while providing the child details during the lists.

  Skill. Router.map () - & gt; this. Source 'atmosphere', - & gt; This.route 'index' this.resource 'environment', {path: ": environment_id"}, - & gt; this. Root 'index' this.route 'show' this.resource 'jobs' this.route 'index' this.resource 'job' this.route 'show'  

Comments