App.PostsRoute=Ember.Route.extend({
model:function(){
return App.Comments;
}
});
var App.Comments=[
{
},
{
}];
In the above code, model doesn’t recognize App.Comments. But if i remove var then its working. why is it so ?
App.PostsRoute=Ember.Route.extend({
model:function(){
return App.Comments;
}
});
var App.Comments=[
{
},
{
}];
In the above code, model doesn’t recognize App.Comments. But if i remove var then its working. why is it so ?
Remove var
before App.Comments. ( you’re not defining a new variable, you’re setting a property on App object )