I tried a lot of things...">All geek questions in one placeAngular2: exit character in component inputI have the following code:<my-comp [title]="Foo component"></my-comp> I tried a lot of things ( '', \', \\', \'', ...) to avoid entering ', but I did not succeed. How can i do this?+4angularScipion Nov 02 '16 at 15:16source share2 answersIt seems that title is a property of the component, so it expects a variable or string. I assume that the correct syntax would be as follows:<my-comp [title]="'Foo\ component'"></my-comp> Add one quotation mark before and after+4Meir Nov 02 '16 at 15:21source shareYou are attached to a property titlethat is probably of type string. What you are actually doing connects this with a javascript expression (well .. angular2), which Foo component, but this is not a valid expression.:title , title="Foo Component": [title]="'Foo\ component'".+1Amit 02 . '16 15:21Source: https://habr.com/ru/post/1659621/More articles:How can I say from a script if the βgit cherry pickβ fails? - gitMKMapview live car tracking - iosHow can I solve an index error from a range? - c #Xcode 8 Important Features with an Autostart Problem - ios"Using an undefined type" with uniqueptr to forward the declared class and default constructor / destination - c ++How do I add a custom HTTP request header to a form or Thymeleaf link? - httpHow to use CreateDateTime in LINQ for entity expressions - c #Any exceptions to the success story of using Android Keystore to generate keys? - androidRedis Cluster does not promote Slave for management when the wizard is down - redisMinimum number of nodes in Redis Cluster - redisAll Articles
I have the following code:
<my-comp [title]="Foo component"></my-comp>
I tried a lot of things ( '', \', \\', \'', ...) to avoid entering ', but I did not succeed. How can i do this?
''
\'
\\'
\''
'
It seems that title is a property of the component, so it expects a variable or string. I assume that the correct syntax would be as follows:
<my-comp [title]="'Foo\ component'"></my-comp>
Add one quotation mark before and after
You are attached to a property titlethat is probably of type string. What you are actually doing connects this with a javascript expression (well .. angular2), which Foo component, but this is not a valid expression.
title
Foo component
:
title="Foo Component"
[title]="'Foo\ component'"
Source: https://habr.com/ru/post/1659621/More articles:How can I say from a script if the βgit cherry pickβ fails? - gitMKMapview live car tracking - iosHow can I solve an index error from a range? - c #Xcode 8 Important Features with an Autostart Problem - ios"Using an undefined type" with uniqueptr to forward the declared class and default constructor / destination - c ++How do I add a custom HTTP request header to a form or Thymeleaf link? - httpHow to use CreateDateTime in LINQ for entity expressions - c #Any exceptions to the success story of using Android Keystore to generate keys? - androidRedis Cluster does not promote Slave for management when the wizard is down - redisMinimum number of nodes in Redis Cluster - redisAll Articles