Routing Guide Clarification

From the ember guide:

ROUTING …

At any given time, your application has one or more active route handlers. The active handlers can change for one of two reasons:

The user interacted with a view, which generated an event that caused the URL to change.

I’m trying to port code from pre 1.10 ember to 1.13.8. I have ported a view/controller pair to a component.

My component used to use the controller method ‘transitionToRoute’.

It is not clear to me how to actually generate an event in my component to cause a URL to change.

Could someone please enlighten me?

2 Likes

You can use this.sendAction('deleteAction'); and bubble yourself. See:

https://github.com/broerse/ember-cli-blog/blob/master/app/components/blog-post-edit.js https://github.com/broerse/ember-cli-blog/blob/master/app/components/blog-post.js https://github.com/broerse/ember-cli-blog/blob/master/app/templates/post.hbs https://github.com/broerse/ember-cli-blog/blob/master/app/routes/posts.js

I hope this helps you.

That defiantly helps so much.

Your example is very nice an clear and highlights the sendAction principle clearly.

Thanks! Nice it helped you.