0

I am using angularjs directive and I want to add double quotes for a value which is get through data binding in angularjs template.

my code is,

template = '<div>'+
            '<a>'+'User name is ' + user.name  + '</a>'+
            '</div>' 

I need the output as given below User name is "davit"

How to add double quotes for the name davit?

2 Answers 2

1

just add the double quotes before and after single quotes like this

'<a>'+'User name is "' + user.name  + '"</a>'+
Sign up to request clarification or add additional context in comments.

Comments

0

Try this:-

template = '<div>'+ '<a>'+'User name is "' + user.name  + '"</a>'+ '</div>' 

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.