I'm new to coding so I have
<strong> ValueFromTypeScript </strong>
in my html
and I want to pull name from my ts file
name:string = "George";
is this possible?
-
Yes it is possible, what have you tried. Please share a minimal reproducible examplenircraft– nircraft2020-01-28 16:25:45 +00:00Commented Jan 28, 2020 at 16:25
Add a comment
|
2 Answers
Simply tried this
<strong> {{name}}</strong>
here {{}} is called string interpolation.
Have a look in angular documentation
This has sample app as well which we surely give you good understanding
2 Comments
Martin Parenteau
The property is called
name.Passionate Coder
oh.. thanks @ConnorsFan.. I did typo error corrected now
You can use string interpolation to achieve that...refer this to know more
In your case it would be
<strong> {{ name }} </strong>