Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8425319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:14:16+00:00 2026-06-10T04:14:16+00:00

Is there a possibility to add custom action (basically any piece of JS code)

  • 0

Is there a possibility to add custom action (basically any piece of JS code) to the routing event?

There is an application which needs to alter some part of the page “outside” of the app. Yes, that part of the page should be in the app, but it’s not. So, I need to change the “outside” DOM a little on some routing events. For example, when I’m at the index state, there is an empty element somewhere, when I move to another state, that element changes its content to “Back” and gets active. Also, I would like to bind the ember routing action to onClick event on that element.

I tried to find such thing but there seems to be nothing. I found this, but it does not solve my problem at all:
How do I bind events directly to existing HTML, without using any kind of views, in Ember.js?

Thanks for your time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T04:14:18+00:00Added an answer on June 10, 2026 at 4:14 am

    It might help to know there is an enter event you could handle inside a route:

    other: Ember.Route.extend({
        route: '/other',
        connectOutlets: function(router, context) { /* ...? */ }),
        enter: function(router) {
            // ...
        }
    })
    

    Not sure if there’s a solution that better suits your needs.

    Update: If you use the action helper, the click event will trigger the action, as you desire. Example — in the template: <a {{action gotoOtherState href="true"}}>Go to other state</a>, and in the route you were in (or an ancestor… the index route in this case): gotoOtherState: Ember.Route.transitionTo('path.to.otherState').

    The href=true is an optional touch for <a> tags. You can also define your own transitions:

    gotoOtherState: function(router, event) {
        // Setup? Teardown?
        // ...
        router.transitionTo('path.to.otherState');
    }
    

    Note: if you pass a context in your action helper (e.g. {{action gotoOtherState this}}), you can access it via event: router.transitionTo('path.to.otherState', event.context);

    Update 2: enter is a private hook whereas activate is a new public hook (see http://emberjs.com/blog/2013/02/15/ember-1-0-rc/)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any possibility in Yii to add more info in yiisession table. Be
Is there a possibility, to add an image to menu item, from java code
Is there possibility to add some custom actions to Android phone calls log? For
Is there a possibility to add an Applet (JBufferedApplet to be specific) to a
I have a devexpress Grid with GridView and there is the possibility to add
Is there any possibility to change the text-color of some parts in a textarea
Is there any possibility of giving variable name to hex/rgb numbers in .qss file
Is there any possibility to split classes for a two files like in C++?
Is there a possibility to block chance to add the same data to SPList?
Is there a possibility to add a tooltip to a QPushButton. I mean, that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.