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 9158437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:14:45+00:00 2026-06-17T13:14:45+00:00

I would like to install a event handler to handle all <a class=nav />

  • 0

I would like to install a event handler to handle all <a class="nav" /> links. Currently I am providing the same entry for event maps in almost every template. So I get entries like

Template.XXX.events = { 
  'click a.nav'          : linkCallback
}

all over the place. Is there a way to install event handlers globally? I couldn’t find a way when looking at the documentation, but tmeasdays meteor-router seems to be able to do it. I just cant figure out how.

  • 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-17T13:14:46+00:00Added an answer on June 17, 2026 at 1:14 pm

    Just make a template that wraps every other template and attach the events to it:

    <body>
      {{> body}}
    </body>
    
    <template name="body">
    </template>
    
    Template.body.events = function() {
      'click .nav': linkCallback
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to be able to install all of the NuGet packages in
I would like to install application in google tv emulator, but it don't install
I would like to install Visual Studio 2008 on a PC with an existing
I would like to install Jobberbase in my website. I have a hosting plan
I would like to install a gem (JSON) on the client side, but only
I would like to install my setup content only to one specific directory, so
I have a centos server and would like to install selenium, primarily for taking
To extend RavenDB's capabilities I would like to install the bundles that are available
I would like to make my drivers to install on x64 Windows without the
I would like to know if I can install IIS 7.5 on Windows Server

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.