0
這對我來說很難理解ember.js錯誤。我總是必須查看我的所有代碼並進行隨機更改,因爲我無法確定哪裏出錯。 特別我有這種錯誤,修改(但保持在結構上是相同的)的peepcode例如:餘燼:瞭解錯誤
Uncaught Error: Something you did caused a view to re-render after it rendered but
before it was inserted into the DOM. application.js:30508
Ember.merge.rerender application.js:30508
Ember.View.Ember.CoreView.extend.rerender application.js:29198
Ember.View.Ember.CoreView.extend._controllerDidChange application.js:29117
sendEvent application.js:18480
Ember.notifyObservers application.js:17033
propertyDidChange application.js:17640
iterDeps application.js:17089
dependentKeysDidChange application.js:17113
propertyDidChange application.js:17638
set application.js:16460
Ember.View.Ember.CoreView.extend.createChildView application.js:30079
Ember.ContainerView.Ember.View.extend.init application.js:30944
superWrapper application.js:15393
Ember._Metamorph.Ember.Mixin.create.init application.js:32704
superWrapper application.js:15393
Class application.js:24583
Mixin.create.create application.js:24842
Ember.View.Ember.CoreView.extend.createChildView application.js:30063
Ember.merge.appendChild application.js:30517
Ember.View.Ember.CoreView.extend.appendChild application.js:29931
EmberHandlebars.ViewHelper.Ember.Object.create.helper application.js:33864
get application.js:34043
get application.js:38247
EmberHandlebars.registerHelper.context application.js:33224
program1 application.js:49634
(anonymous function) application.js:14488
Ember.View.Ember.CoreView.extend.render application.js:29173
Ember.CoreView.Ember.Object.extend._renderToBuffer application.js:28180
Ember.View.Ember.CoreView.extend._renderToBuffer application.js:29728
superWrapper application.js:15393
Ember.CoreView.Ember.Object.extend.renderToBuffer application.js:28159
Ember.Instrumentation.instrument application.js:15703
Ember.CoreView.Ember.Object.extend.renderToBuffer application.js:28158
Ember.ContainerView.Ember.View.extend.render application.js:30985
Ember.View.Ember.CoreView.extend.forEachChildView application.js:29412
Ember.ContainerView.Ember.View.extend.render application.js:30984
superWrapper application.js:15393
Ember.CoreView.Ember.Object.extend._renderToBuffer application.js:28180
Ember.View.Ember.CoreView.extend._renderToBuffer application.js:29728
superWrapper application.js:15393
Ember.CoreView.Ember.Object.extend.renderToBuffer application.js:28159
Ember.Instrumentation.instrument application.js:15703
Ember.CoreView.Ember.Object.extend.renderToBuffer application.js:28158
Ember.merge.appendChild application.js:30520
Ember.View.Ember.CoreView.extend.appendChild application.js:29931
EmberHandlebars.ViewHelper.Ember.Object.create.helper application.js:33864
get application.js:34043
handlebarsGet application.js:34260
Ember.Handlebars.registerHelper.template application.js:34684
anonymous application.js:49660
(anonymous function) application.js:14452
Ember.View.Ember.CoreView.extend.render application.js:29173
Ember.CoreView.Ember.Object.extend._renderToBuffer application.js:28180
Ember.View.Ember.CoreView.extend._renderToBuffer application.js:29728
superWrapper application.js:15393
Ember.CoreView.Ember.Object.extend.renderToBuffer application.js:28159
Ember.Instrumentation.instrument application.js:15703
Ember.CoreView.Ember.Object.extend.renderToBuffer application.js:28158
Ember.ContainerView.Ember.View.extend.render application.js:30985
Ember.View.Ember.CoreView.extend.forEachChildView application.js:29412
Ember.ContainerView.Ember.View.extend.render application.js:30984
superWrapper application.js:15393
Ember.CoreView.Ember.Object.extend._renderToBuffer application.js:28180
Ember.View.Ember.CoreView.extend._renderToBuffer application.js:29728
superWrapper application.js:15393
Ember.CoreView.Ember.Object.extend.renderToBuffer application.js:28159
Ember.Instrumentation.instrument application.js:15703
Ember.CoreView.Ember.Object.extend.renderToBuffer application.js:28158
Ember.merge.appendChild application.js:30520
Ember.View.Ember.CoreView.extend.appendChild application.js:29931
EmberHandlebars.ViewHelper.Ember.Object.create.helper application.js:33864
get application.js:34043
get application.js:38247
EmberHandlebars.registerHelper.context application.js:33224
anonymous application.js:49530
(anonymous function) application.js:14452
Ember.View.Ember.CoreView.extend.render application.js:29173
Ember.CoreView.Ember.Object.extend._renderToBuffer application.js:28180
Ember.View.Ember.CoreView.extend._renderToBuffer application.js:29728
superWrapper application.js:15393
Ember.CoreView.Ember.Object.extend.renderToBuffer application.js:28159
Ember.Instrumentation.instrument application.js:15703
Ember.CoreView.Ember.Object.extend.renderToBuffer application.js:28158
Ember.View.Ember.CoreView.extend.createElement application.js:29570
Ember.merge.insertElement application.js:30459
Ember.View.Ember.CoreView.extend._insertElement application.js:29502
RunLoop._prev application.js:18573
Ember.handleErrors application.js:14910
invoke application.js:18571
invokeOnceTimer application.js:19016
RunLoop._prev application.js:18573
Ember.handleErrors application.js:14910
invoke application.js:18571
iter application.js:18643
RunLoop.flush application.js:18697
RunLoop.end application.js:18602
tryable application.js:18806
Ember.tryFinally application.js:15548
Ember.run.end application.js:18809
Ember.tryFinally application.js:15550
Ember.run application.js:18765
Ember.Mixin.create.init application.js:41369
sendEvent application.js:18480
Ember.Evented.Ember.Mixin.create.trigger application.js:24352
DS.Model.Ember.Object.extend.trigger application.js:45189
superWrapper application.js:15393
states.rootState.Ember.State.create.loaded.DS.State.create.materializing.DS.State.create.firstTime.DS.State.create.exit application.js:44608
RunLoop._prev application.js:18573
Ember.handleErrors application.js:14910
invoke application.js:18571
invokeOnceTimer application.js:19016
RunLoop._prev application.js:18573
Ember.handleErrors application.js:14910
invoke application.js:18571
iter application.js:18643
RunLoop.flush application.js:18697
RunLoop.end application.js:18602
tryable application.js:18806
Ember.tryFinally application.js:15548
Ember.run.end application.js:18809
Ember.tryFinally application.js:15550
Ember.run application.js:18765
DS.RESTAdapter.DS.Adapter.extend.findAll.ajax.success application.js:49038
jQuery.Callbacks.fire application.js:1038
jQuery.Callbacks.self.fireWith application.js:1149
done application.js:8075
jQuery.ajaxTransport.send.callback
錯誤發生時,然後導航輸入這個地址(未導航) transport_documents/2
。如果我瀏覽到這條道路,相反,錯誤的是不同的: 第一運輸單據我打開就可以了,而導航到第二我得到 You can't call renderToBufferIfNeeded on a destroyed view
是灰燼太年輕,實施錯誤處理,可以使一個對開發人員有意義,還是有一些方法可以更輕鬆地調試我的代碼?
編輯: 這裏是我的HBL:
應用
<div class="container">
<div class="content">
{{outlet}}
</div>
</div>
TRANSPORT_DOCUMENTS
<table class="table table-striped">
<thead>
<tr>
<th>
n
</th>
<th>
data
</th>
<th>
Azioni
</th>
</tr>
</thead>
<tbody>
{{#each controller}}
<tr>
<td>
{{#linkTo "transport_document" this}}{{number}}{{/linkTo}}
</td>
<td>{{#linkTo "transport_document" this}}{{date}}{{/linkTo}}</td>
<td>
<a target="_blank" {{bindAttr href="printable_url"}} class="btn btn-info btn-small">
<i class="icon-white icon-print"></i>
</a>
<a target="_blank" {{bindAttr href=pdf_url}} class="btn btn-info btn-small">
<i class="icon-white icon-print"></i>
</a>
{{#linkTo transport_document this class='btn btn-warning btn-small'}}
<i class="icon-white icon-edit"></i>
{{/linkTo}}
<button {{action this.destroy target="controller"}} class='btn btn-danger btn-small'>
<i class="icon-white icon-remove"></i>
</button>
</td>
</tr>
{{outlet}}
{{/each}}
</tbody>
</table>
TRANSPORT_DOCUMENT
<p>Hello world</p>
[R OUTER
App.Router.map ->
@route "index", path: "/"
@resource "transport_documents", ->
@route 'new'
@resource 'transport_document', {path: "/:transport_document_id"}
App.Router.reopen
location: 'history'
App.TransportDocumentsRoute = Ember.Route.extend
model: -> App.TransportDocument.find()
我知道了'debugger'命令 –
您可以添加您的視圖模板內造成的? – MilkyWayJoe
完成。添加了我的模板和路由器。我沒有查看代碼 –