0

I am trying to have title conditionally but not sure how i can add some static text with else expression

In my code, both myTooltip and displayName are angular expressions. This work fine.

However, what if i want to append static text i.e. Mr before displayName. how can i do that?

title="{{(dataAvaialble ? myTooltip : displayName)}}"

I could wrote like this but it gives error

title="{{(dataAvaialble ? myTooltip : 'Mr' displayName)}}"
1
  • you can create a function and call it in ng-attr-title Commented Apr 27, 2016 at 12:16

1 Answer 1

1

This should work:

ng-attr-title="{{ dataAvaialble ? myTooltip : 'Mr' + displayName }}
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.