2
어레이 컨트롤러 변수에 액세스 할 수 없습니다. 내가 예를 들어,이 간단한 응용 프로그램이 있습니다Ember.js 컨트롤러가 작동하지 않습니다.
App.js
App = Ember.Application.create();
App.ApplicationAdapter = DS.FixtureAdapter.extend();
App.Router.map(function() {
this.route('hello');
});
App.IndexRoute = Ember.Route.extend({
redirect: function() {
this.transitionTo('hello');
}
});
App.HelloController = Ember.ArrayController.extend({
name: 'tom'
});
App.HelloRoute = Ember.Route.extend({
model: function() {
return this.store.find('hello');
}
});
App.Hello = DS.Model.extend({
title: DS.attr('string')
});
App.Hello.FIXTURES = [{
id: 1,
title: 'hello'
},{
id: 2,
title: 'hello'
}];
을 내 견해는 다음과 같습니다 : 나는이 코드를 저장할 때
<script type="text/x-handlebars" data-template-name="application">
<h2>Welcome to Ember.js</h2>
{{outlet}}
</script>
<script type="text/x-handlebars" data-template-name="hello">
{{#each}}
{{title}} {{name}}
{{/each}}
</script>
페이지가 그냥 "안녕하세요", "안녕하세요"렌더링 나는 "hello tom" "hello tom"을 기대한다. 내가 뭘 잘못하고있어?
도움주세요.
이 작동 해당 컨트롤러에 감사 속성을 넣어하는 것입니다! – cmszc