mercredi 7 janvier 2015

nested router going back to parent

I have nested router setup something like this:



this.resource('companies', function() {
this.resource('company', {path:':company_id'}, function() {
this.resource('employees', {path:'employees/:company_id'});
});
});


When I click link to company and then link to employee, it's fine. Unless I move to a different company (id) first, if I continue to click link to the same company again, it doesn't display the company.


So basicaly 1st I go to /companies, it lists the companies, each one will have two links, one to /companies/1, other to /companies/1/employees/1, if I move to /companies/1/employees/1, then back to /companies/1, it no longer renders unless I first go to /companies/2, then move to /companies/1 will appear. Then the process repeats if I'm on the same companies "id" path.


I have it setup so that the same outlet is used for company and employees, and everything works except this.


I'm not sure what the problem is as I'm new to Ember.js and experimenting. Thanks for any response.


Aucun commentaire:

Enregistrer un commentaire