Join the Stack Overflow Community
Stack Overflow is a community of 6.5 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

I'm an angular2 beginner and I've written this piece of code in my dev/app.component.ts

enter image description here

It works, when I go to the browser "Max Brown is displayed". Now I want to write the template part on different lines like this:

enter image description here

But I get this error in Chrome console:

Uncaught TypeError: Cannot read property 'split' of undefined
share|improve this question
up vote 23 down vote accepted

Wrap the text in ` (backticks) instead of single quotes ', then it can span multiple lines.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.