ember.js - Ember Nested Routing -


in application.hbs want to:

{{#linkto 'pieces/newpiece' }}new piece{{/linkto}} 

so set router:

app.router.map(function() {   this.resource('pieces', function(){     this.route('newpiece');   }); }); 

yet get:

the route pieces/newpiece not found 

any direction appreciated

update

i changed:

{{#linkto 'pieces/newpiece' }}new piece{{/linkto}}  

to

{{#linkto 'pieces.newpiece' }}new piece{{/linkto}},   

and took care of error, want call 'newpiece' function of piecescontroller.

you want use {{action}} helper that. guide:

you may want trigger high level events in response simple user event (like click).

in general, these events manipulate property on controller, change current template via bindings.

in case, assuming pieces current controller in context use:

<a href='#' {{action newpiece}}>new piece</a> 

jsbin example


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -