samedi 21 mars 2015

Error while processing route: Cannot read property 'connectOutlet' in Ember.js

I'm getting the following error after upgrading Ember to the latest version:



Error while processing route: portfolio Cannot read property 'connectOutlet'


The error takes place whenever I navigate for example from:



http://localhost:8080/#/portfolio


to:



http://localhost:8080/#/publications


The weird thing is that if I refresh the pages many times sometimes it works and some times it's doesn't so feels like some file is loaded too late or maybe loaded twice.


aplication.hbs


The application view renders the header, footer and main container, which contains the application {{outlet}}.



<!-- ... -->
<div class="container" id="maincontainer">
<div class="maincontainer">
{{outlet}}
</div>
</div>
<!-- ... -->


index.hbs


My index view renders a couple of subviews:



<div class="jumbotron fadeInUp animated">
<div class="row">
<div id="summary_content">
{{view view.CvSummaryView}}
</div>
</div>
</div>


routes In all my routes I'm only adding the model() function. I'm not overriding renderTemplate() or anything else.



define([
'Ember'
],
function (Ember) {
"use strict";

return Ember.Route.extend({
model: function()
{
var result = {};

$.ajax({
async: false,
dataType: "json",
url: './website/js/models/portfolio.json',
success: function(data){
result.portfolio = data;
}
});

return result;
}
});
}
);


I tried the following with no luck:



renderTemplate: function(){
this.render({
outlet: "main",
into: "application"
});
}


Do you have any ideas about what can be the root cause of this issue?


The entire app source code can be found at http://ift.tt/1MYUJOQ


Thanks!





Aucun commentaire:

Enregistrer un commentaire