Sharing Top Content from the Angular-sphere.

Recursion in Angular Components – NetanelBasal

  • In the short article, we are going to create a component that will take as Input comments and will know how to display them in a recursive way.
  • We don’t want to render the component when there is no comments, so we need to add the ngIf directive.
  • Never miss a story from NetanelBasal , when you sign up for Medium.
  • For instance, when you have a page with comments, you need to be able to render nested comments and reuse the same component.
  • Follow me on Medium or Twitter to read more about Angular!

There are times that you need to render a template recursively. For instance, when you have a page with comments, you need to be able to render nested comments and reuse the same component. In this…

@JavaScriptKicks: Recursion in Angular Components by @NetanelBasal #javascript #angularjs

There are times that you need to render a template recursively. For instance, when you have a page with comments, you need to be able to render nested comments and reuse the same component.

comments and will know how to display them in a recursive way.

This is the JSON structure that we expect to get from our server. For this demonstration, we will make it static. ( you can change this structure to how you prefer it )

directive. ( not required if you don’t have any styles attached to the host )

Recursion in Angular Components – NetanelBasal

Comments are closed, but trackbacks and pingbacks are open.