O'Reilly logo

Meteor: Full-Stack Web Application Development by Marcelo Reyna, Isaac Strack, Fabian Vogelsteller

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating customized global helpers

As you begin to really dig into templates, you'll soon discover how truly great template helpers are. You can access data inline and drastically reduce the amount of code you need to write.

You will, however, eventually run into a situation where you find yourself repeating the same logic in multiple, in-template helpers. Wouldn't it be great if there was a way to create global helpers accessible from any template? Well, Meteor has a solution for this too! This recipe will show you how to create global template helpers using the Template.registerHelper function.

Getting ready

We will use the codebase from the Building a smooth interface with Bootstrap recipe, found in this chapter. Please follow that recipe first ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required