0
 <p class="smallText">{{vehicleItem.registration}}, {{vehicleItem.colour}} {{vehicleItem.make}} {{vehicleItem.model}}</p>

I'd like to capitalize vehicle registration and model and make should be camel case

3
  • Please see how to ask a question to ensure you can get an appropriate response: stackoverflow.com/help/how-to-ask Commented Jun 19, 2017 at 13:18
  • I have edited the question @BobbySpeirs Commented Jun 19, 2017 at 13:20
  • provide your code Commented Jun 19, 2017 at 13:24

3 Answers 3

1

I will suggest wrapping registration and make with a span containing different classes e.g.

<p><span class="capitalize">{{vehicleItem.registration}}, {{vehicleItem.colour}} <span class="camel-case">{{vehicleItem.make}} </span> {{vehicleItem.model}}</p>

This way you are adding "two" css rules to one element. I also recommend you achieve the camelcase style using Javascript.

Sign up to request clarification or add additional context in comments.

Comments

0

You can write as many classes into an HTML tag as you want, thereby applying as many CSS rules as you want. Example:

<p class="smallText myclass_1 myclass_2">

Comments

0

I'm not experienced with angular but you should be able to use different functions like

capitalizeFirstLetter(vehicleItem.registration)

and camelize(vehicleItem.model)

Converting any string into camel case

How do I make the first letter of a string uppercase in JavaScript?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.