How to truncate text in Angular2?
Two way to truncate text into angular. let str=”How to truncate text in angular”; 1. Solution {{str | slice:0:6}} Output: how to If you want to append any text after slice string like {{ (str.length>6)? (str | slice:0:6)+’…’:(str) }} Output: how to… 2. Solution(Create custom pipe) if you want to create custom truncate pipe import … Read more