0
방금 ember.js를 시작했습니다. 내 마크 업 코드는ember.js에서 값 반복 및 인쇄
<script type="text/x-handlebars" data-template-name="home">
<h1>Names: </h1>
{{#each home in App.HomeController.content}}
<h1>Name: </h1>
{{home.name}}<br />
{{/each}}
</script>
하고 내 자바 스크립트 코드는
App = Ember.Application.create();
App.Router.map(function() {
this.route("home", {
path: "/"
});
});
/*
* HomeController
*/
App.HomeController = Ember.ArrayController.extend({
content: [],
templateName: 'home',
init: function(){
var self = this;
$.ajax({
url: 'response.php',
dataType: 'JSON',
type: 'POST',
success: function(res){
self.set('content', res);
},
error: function(){
}
});
}
})
이다하지만 내가 이름을 인쇄 할 수없는 것 같다. 나는 그 이름을 인쇄 할 수 없다. &. 어떤 몸이라도 나를 도울 수 있습니까?
감사