title: Displaying comma separated string in Angular 6
body: <p>I am trying to loop through a comma separated string in Angular 6. </p>
  
  <pre><code>public  getCategory(){
      this.Jarwis.getCategorys().subscribe((data:  Array&lt;object&gt;) =&gt; {
      this.categorys  =  data;
      console.log(this.categorys);
  });
  </code></pre>
  
  <p>This is my function which have a console log as </p>
  
  <pre><code>(3) [{…}, {…}, {…}, {…}, {…}, {…}]
   0: {id: 4, category_name: "Agriculture", sub_category_names: "Other Agriculture,Vineyards and Wineries,Greenhouses,Tree Farms and Orchards"}
   1: {id: 5, category_name: "Automotive and Boat", sub_category_names: "Auto Repair and Service Shops,Car Dealerships,Marine/Boat Service and Dealers,Junk and Salvage Yards"}
   2: {id: 13, category_name: "Beauty and Personal care", sub_category_names: "Massage,Tanning Salons,Spas,Hair Salons and Barber Shops"}
  </code></pre>
  
  <p>I can display category name in view page with the help of </p>
  
  <pre><code>&lt;li *ngFor='let category of categorys'&gt;
    &lt;div&gt;{{ category.category_name }}&lt;/div&gt;
  &lt;/li&gt;
  </code></pre>
  
  <p>But how can I display sub_category_names in different divs just like this</p>
  
  <pre><code>&lt;div&gt; subcategory_name1 &lt;/div&gt;
  &lt;div&gt; subcategory_name2 &lt;/div&gt;
  </code></pre>
  
  <p>Please help</p>