Tree structure in Angular with PrimeNg
Tree structure in Angular with PrimeNg PrimeNg is a Angular component library. Compared to other component libraries like ngbootstrap or material, PrimeNg comes with more advance components which can’t be found elsewhere, one of them being the tree structure. Having the component is one thing but having to build the tree data which can be used by the component is another hard part. Therefore today I will firstly show how we can use PrimeNg and secondly I will show how we can mold data to fit in the model used to build PrimeNg tree. This post will be composed by 3 parts: 1. Install PrimeNg 2. Mold data for Tree structure with reduce 3. Other use cases and benefits 1. Install PrimeNg PrimeNg can be added via npm npm install primeng --save . It also needs font awesome for icons which can be added via npm npm install font-awesome --save . After installed, under the /primeng/resources folder, we should be able to see the style files. Those needs to be added to the styles in the a...