Capitalising Each Word of a Name

In this lesson, you’ll learn how to capitalize each word entered by the user in an Ember application.

Our current feature request is eligible to be implemented by a helper since it’s a simple text transformation.

We want to allow the user to type “long distance calling” as a band name and have it displayed as “Long Distance Calling.”

Creating a helper

As usual, we begin by using the appropriate Ember-CLI generator. This time, we need a helper called capitalize, which we will create using the following command:

ember g helper capitalize

Note: We have already created the above helper, and you can type the command above in the terminal widget below to check or create helpers with different names.

Get hands-on with 1200+ tech skills courses.