2
/app.js
var Welcome = Ember.Application.create({});
Welcome.person = Ember.View.extend({
personName: 'Andrew'
});
표시되지 않습니다, 뷰의 일부가 된 index.html의 내용이다 :Ember.js는 : 핸들 바는 여기에 아무것도에게
/index.html
<!doctype html>
<!--[if lt IE 7 ]> <html lang="en" class="ie6"> <![endif]--> <!--[if IE 7 ]> <html lang="en" class="ie7"> <![endif]--> <!--[if IE 8 ]> <html lang="en" class="ie8"> <![endif]--> <!--[if IE 9 ]> <html lang="en" class="ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en"> <!--<![endif]-->
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="author" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<script type="text/x-handlebars">
{{personName}}
</script>
<script src="js/libs/handlebars-1.0.0.beta.6.js"></script>
<script src="js/libs/ember-1.0.pre.min.js"></script>
<script src="js/app.js"></script>
</body>
</html>
내 질문은 왜 아무것도 표시되지 않는입니까? personName
의 내용을 렌더링하면 안됩니까?
업데이트 : 엠버의 스타터 키트를 사용하고
. 이미 정의 된 뷰가 있습니다. 방금 개체에 속성을 하나 더 추가했지만 여전히보기에는 표시되지 않습니다.
App.MyView = Em.View.extend({
mouseDown: function() {
window.alert("hello world!");
},
name: 'Andrew'
});
.html과의보기 부분은 다음과 같습니다 이벤트가 작동
<script type="text/x-handlebars">
{{#view App.MyView}}
<h1>Hello world {{name}}!</h1>
{{/view}}
</script>
때문에, 접근 할 수 있어야 이름 아닌가요?
내 업데이트를 참조하십시오. – Andrew
updated 대답 : –
이제 작동합니다 : D 조 감사합니다 – Andrew