ember.js에 문제가 있습니다. 다음 라우팅 설정을 사용하면 항목/새로운 경로를 사용할 수 없습니다. 색인은 잘 작동하지만 항목/새 템플릿은 렌더링을 거부합니다. renderTemplate 내부에서 뷰를 렌더링하려고 시도하지만 어디에서 잘못했는지 확신 할 수 없다고 생각합니다. 귀하의 도움을 많이 주시면 감사하겠습니다.에버에서 중첩 된 경로와 관련된 트러블 렌더링보기
Journal.Router.map ->
@resource 'entries', {path: '/' }, ->
@route 'new'
return
return
Journal.EntriesNewRoute = Ember.Route.extend
renderTempalte: ->
@render 'entriesNew', {
into: 'application'
}
setupController: (controller) ->
controller.set 'heading', 'new entry'
return
Journal.EntriesNewView = Ember.View.extend
className: ['entries-new']
templateName: 'entries/new'
Journal.EntriesNewController = Ember.Controller.extend
heading: "New Journal Entry"
createEntry: ->
title = @get 'newTitle'
content = @get 'newContent'
if !title.trim() and !content.trim() then return null
Journal.Entry.createRecord
title: title
content: content
@get('store').commit()
return
그리고 경로의 항목/새 템플릿
{{ heading }}
{{view Ember.TextField id="entry-title" placeholder="Enter a title" valueBinding="newTitle"}}
{{view Ember.TextArea id="entry-content" placeholder="What do you have to say?" valueBinding="newContent"}}
<button {{action "createEntry"}} class="save">Save</button>
나는 거의 같은 문제가 발생합니다. 템플릿이 렌더링되는 방법과 중첩 된 경로의 경우 렌더링되는 위치를 이해하지 못합니다. –
이 작업에 어려움이 있으시면 [Peepcode 's Fire Up Ember.js Tutorial] (https://peepcode.com/products/emberjs)를 적극 권장합니다. 많은 질문에 답하고 언제 경로를 중첩해야하는지에 대해 많은 혼란을 겪었습니다. – JeremyC