Angular 2 templates have a special let syntax that allows you to define and pass a context when they’re being generated.
Most templates don't have inputs, and there's no real way to push the data in from a line like this. What you do is you set these let statements, these let attributes. If I say let description, then that description can live in here. We'll say description, that'll render that out. Copy and paste that here as well, then you say this attribute will be equal to description.
This one is going to come off what's called a context for this template. The context is the second parameter, so if I say description is sweet, hit save. Now every time I click create template, you'll see sweet come through because sweet's being passed in the context. You can read the context values off of here, pass them into the let declarations, and then those are rendered out. So keep on clicking, sweet, sweet, sweet. It's sweet templates all the way down.
You must be a Pro Member to view code
Access all courses and lessons, track your progress, gain confidence and expertise.