我的模板中有以下内容:
= hb 'render "partials/search_field" controller="application"'
对insertNewLine
,“搜索”执行操作。
App.ApplicationController = Ember.Controller.extend(
needs: ["search"]
query: Ember.computed.alias("controllers.search.query")
actions:
search: ->
query = @get('query')
@transitionToRoute('search', {queryParams: {query:query}})
)
在我的搜索路线中,查询参数刷新模型:
App.SearchRoute = Ember.Route.extend(
App.PageableRouteMixin,
queryParams:
query:
refreshModel: false
model: (params) ->
@store.findQuery('search',params)
)
如果我使用渲染的partial,从索引状态以外的任何状态,它都可以正常工作。但是,如果我尝试从初始状态,索引,我在我的控制台中得到以下错误:
调试输出如下:
DEBUG: -------------------------------
DEBUG: Ember : 1.7.1+pre.f095a455
DEBUG: Ember Data : 1.0.0-beta.12-canary
DEBUG: Handlebars : 1.3.0
DEBUG: jQuery : 1.11.1
DEBUG: -------------------------------
Attempting URL transition to /
Transition #0: application: calling beforeModel hook
Transition #0: application: calling deserialize hook
Transition #0: application: calling afterModel hook
Transition #0: index: calling beforeModel hook
Transition #0: index: calling deserialize hook
Transition #0: index: calling afterModel hook
Transition #0: Resolved all models on destination route; finalizing transition.
Rendering application with default view <(subclass of Ember.View):ember416> Object {fullName: "view:application"}
Rendering index with default view <(subclass of Ember.View):ember437> Object {fullName: "view:index"}
Transitioned into 'index'
Transition #0: TRANSITION COMPLETE.
Ember Inspector Active VM1234:161
Ember.Binding<ember596>(_parentView.context.query -> value) <- i Class {placeholder: "Search jobs", onInsertNewline: "search", classNames: Array[3], valueBinding: Binding, templateData: Object…}
Ember.Binding<ember596>(_parentView.context.query -> value) <- io Class {placeholder: "Search jobs", onInsertNewline: "search", classNames: Array[3], valueBinding: Binding, templateData: Object…}
Ember.Binding<ember596>(_parentView.context.query -> value) <- ios Class {placeholder: "Search jobs", onInsertNewline: "search", classNames: Array[3], valueBinding: Binding, templateData: Object…}
Uncaught RangeError: Maximum call stack size exceeded
Ember.assert
get
ControllerMixin.reopen.transitionToRoute
ControllerMixin.reopen.transitionToRoute
ControllerMixin.reopen.transitionToRoute
...