Context is a feature of angular Templates, so if you want to pass context around you have to use templates at least. The structural directive is just kind of a syntactically nice way of creating a template and getting context. Unfortunately, templates aren't described super well in Angular documentation :(
Without a structural directive, you use templates directly. With that, you end up with
If you want to see more about this strategy, you can read Stephen's article here. Under the hood, these are both doing the same thing, just a difference in syntax. But either way, you have to have templates.
Awesome article, Can you share how to use directly rather than a structural directive in this use case? How to pass context in that case?
Thanks for reading 😀
Context is a feature of angular Templates, so if you want to pass context around you have to use templates at least. The structural directive is just kind of a syntactically nice way of creating a template and getting context. Unfortunately, templates aren't described super well in Angular documentation :(
Without a structural directive, you use templates directly. With that, you end up with
instead of
If you want to see more about this strategy, you can read Stephen's article here. Under the hood, these are both doing the same thing, just a difference in syntax. But either way, you have to have templates.
Thank you so much for wonderful explanation.