Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ember.js/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ember.js:带有路由的堆栈溢出_Ember.js - Fatal编程技术网

ember.js:带有路由的堆栈溢出

ember.js:带有路由的堆栈溢出,ember.js,Ember.js,我有这个路由器: App.Router.map -> @route "index", path: "/" @resource "raw_materials", -> @route 'new' @resource "raw_material", {path: ":raw_material_id"}, -> @route 'edit' 我将自己放在url:raw_materials/20,然后单击我的编辑按钮(它链接到raw_mater

我有这个路由器:

App.Router.map ->
  @route "index", path: "/"
  @resource "raw_materials", ->
    @route 'new'    
    @resource "raw_material", {path: ":raw_material_id"}, ->
      @route 'edit'
我将自己放在url:
raw_materials/20
,然后单击我的编辑按钮(它链接到
raw_materials/20/edit
),余烬给了我一个堆栈溢出:

Maximum call stack size exceeded
guidFor
iterDeps
dependentKeysDidChange
propertyDidChange
contentPropertyDidChange
sendEvent
Ember.notifyObservers
propertyDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.didChange
chainsDidChange
propertyDidChange
contentPropertyDidChange
sendEvent
Ember.notifyObservers
propertyDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.didChange
chainsDidChange
propertyDidChange
contentPropertyDidChange
sendEvent
Ember.notifyObservers
propertyDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.didChange
chainsDidChange
propertyDidChange
contentPropertyDidChange
sendEvent
Ember.notifyObservers
propertyDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.didChange
chainsDidChange
propertyDidChange
contentPropertyDidChange
sendEvent
Ember.notifyObservers
propertyDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.didChange
chainsDidChange
propertyDidChange
contentPropertyDidChange
sendEvent
Ember.notifyObservers
propertyDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.didChange
chainsDidChange
propertyDidChange
contentPropertyDidChange
sendEvent
Ember.notifyObservers
propertyDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.didChange
chainsDidChange
propertyDidChange
contentPropertyDidChange
sendEvent
Ember.notifyObservers
propertyDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.didChange
chainsDidChange
propertyDidChange
contentPropertyDidChange
sendEvent
Ember.notifyObservers
propertyDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.didChange
chainsDidChange
propertyDidChange
contentPropertyDidChange
sendEvent
Ember.notifyObservers
propertyDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.didChange
chainsDidChange
propertyDidChange
contentPropertyDidChange
sendEvent
Ember.notifyObservers
propertyDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.didChange
chainsDidChange
propertyDidChange
contentPropertyDidChange
sendEvent
Ember.notifyObservers
propertyDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.didChange
chainsDidChange
propertyDidChange
contentPropertyDidChange
sendEvent
Ember.notifyObservers
propertyDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.didChange
chainsDidChange
propertyDidChange
contentPropertyDidChange
sendEvent
Ember.notifyObservers
propertyDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.didChange
chainsDidChange
propertyDidChange
contentPropertyDidChange
sendEvent
Ember.notifyObservers
propertyDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.didChange
chainsDidChange
propertyDidChange
contentPropertyDidChange
sendEvent
Ember.notifyObservers
propertyDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.didChange
chainsDidChange
propertyDidChange
contentPropertyDidChange
sendEvent
Ember.notifyObservers
propertyDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.didChange
chainsDidChange
propertyDidChange
contentPropertyDidChange
sendEvent
Ember.notifyObservers
propertyDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.didChange
chainsDidChange
propertyDidChange
contentPropertyDidChange
sendEvent
Ember.notifyObservers
propertyDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.didChange
chainsDidChange
propertyDidChange
contentPropertyDidChange
sendEvent
Ember.notifyObservers
propertyDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.didChange
chainsDidChange
propertyDidChange
contentPropertyDidChange
sendEvent
Ember.notifyObservers
propertyDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.didChange
chainsDidChange
propertyDidChange
contentPropertyDidChange
sendEvent
Ember.notifyObservers
propertyDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.chainDidChange
ChainNodePrototype.didChange
以下是我的路线:

App.RawMaterialsRoute = Ember.Route.extend
  model: -> App.RawMaterial.find()controller.get('currentPage')})

App.RawMaterialRoute = Ember.Route.extend
  model: (params) ->
    App.RawMaterial.find(params.raw_material_id)
这里是我的模板:

---------------------
application.hbl:
{{outlet}}
---------------------
raw_materials.hbl:
{{#each controller}}
  <tr>
    <td>
       {{#linkTo raw_material this}}
         {{name}}
       {{/linkTo}}
    </td>
    <td>
       {{quantity}}
    </td>
    <td>
      <button {{action destroy this target="controller"}} class='btn btn-danger btn-small'>
        <i class="icon-white icon-remove"></i>
      </button>
    </td>
  </tr>
{{/each}}
{{outlet}}
---------------------
raw_material.hbl
{{name}}
{{quantity}}

{{#linkTo raw_material.edit this class='btn btn-warning btn-small'}}
<i class="icon-white icon-edit"></i>
{{/linkTo}}
---------------------
raw_material/edit.hbl
edit form....
---------------------
application.hbl:
{{outlet}}
---------------------
原材料.hbl:
{{{#每个控制器}}
{{{链接到原材料本}
{{name}}
{{/linkTo}
{{数量}}
{{/每个}}
{{outlet}}
---------------------
原材料公司
{{name}}
{{数量}}
{{{#链接到原材料。编辑此class='btn btn warning btn small'}
{{/linkTo}
---------------------
原材料/编辑.hbl
编辑表单。。。。
有什么想法吗?
非常感谢

尝试{{{#链接到原材料。编辑模型class='btn btn warning btn small'}没有例外。它记录以下内容:
已转换为“原材料.原材料.编辑”
,但我看不到我的内容。我把所有需要的门店都放在
原材料/raw\u material/edit
下,我的模板应该放在
原材料/edit.hbs
而不是
原材料/raw\u material/edit.hbs
下,你实际上在
原材料.raw\u materials.edit
下,但既然
原材料
是一种资源,您不需要为模板名称或路由名称指定其前面的内容。因为控制器是代理,因为它是
ObjectController
。更多信息:您可以使用
controller.
而不是
controller.model.
来访问
model
属性。顺便说一句,我认为使用最新的Ember版本,您应该能够将
这个
传递到
{linkTo}