I am very new to CanJs just started learning, I am struck with below problem not able to debug it.
I have model as below:
Localized = can.Model({
findOne : 'GET /resources/localized'
}, {
});
GET /resources/localized ---> fetches available localized languages.
And I have defined a component as below
can.Component({
tag : 'preferences',
template : initView,
init: function() {
console.log(locales);
},
scope : {
locales: new LocalizedModel.findOne({})
}
});
initView has mustache template as below:
<div class="form-group">
<label>{{dateLayout}}</label>
<select class="form-control" id="lang" name="lang" can-change="save">
{{#list locales.languageOptions}}
<option value="{{name}}">{{name}}</option>
{{/list}}
</select>
</div>
But the problem is locales are not getting populate, I could see network call for /resources/localized, any pointers here could really help to understand this.