I can't understand why I cannot visualize my data. If I check with the google app and in the console (App.model.store) they are there but whenever I try to insert them in Handlebars, nothing happen. the more confusing thing is that no error is display.
I prepared a simplify version of my app to post here:
<script type="text/x-handlebars" data-template-name="index">
<header>
<ul>
<li>{{#linkTo "cal"}} Home {{/linkTo}}</li>
<li>{{#linkTo "location"}} location {{/linkTo}}</li>
</ul>
</header>
<section class="content">
{{outlet}}
</div>
</script>
<script type="text/x-handlebars" data-template-name="cal">
<div class="calendar">
Hello!!!
<h2>{{name}}</h2>
</div>
</script>
window.WebCalendar = Ember.Application.create();
WebCalendar.ApplicationAdapter = DS.FixtureAdapter.extend();
WebCalendar.Store = DS.Store.extend({
revision: 12,
adapter: 'DS.FixtureAdapter'
});
/////// ROUTER
WebCalendar.Router.map(function() {
this.resource('index', {path: '/'}, function() {
this.resource("cal", {path: '/'});
this.resource("location", {path: '/location'});
});
});
WebCalendar.CalRoute = Ember.Route.extend({
model: function(){
return this.store.find('cal').toArray();
}
});
////// Model
WebCalendar.Cal = DS.Model.extend({
name: DS.attr('string'),
days_label: DS.attr('string'),
months_label: DS.attr('string'),
days_per_month: DS.attr('number'),
current_date: DS.attr('date')
});
WebCalendar.Cal.FIXTURES = [
{
"id": 1,
"name": "Jhon",
"days_label": ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
"months_label": ['January', 'February', 'March', 'April',
'May', 'June', 'July', 'August', 'September',
'October', 'November', 'December'],
"days_per_month": [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
}
];
I'm really not sure about my JSON file also.. Any help is really appreciate!
Here the codepen
p.s. If you also have any suggestion how to properly check ember in the console, will be super!