In angular controller file, I want to add suffix ... to make shorten a string if it is lengthy but now ...
is now a spread operator in es6 so try using …
and tried but it prints the text …
not ... in HTML
trial 1
let shortName = `${longString.substr(0,9)}${(longString.length>9? '…':'';`
trial 2
$sce.trustAsHtml(shortName + '…')
but in HTML it show &hellp;
not the ...
Note: I can use ng-bind-html
but this string is used as a label in chart which is in <canvas>
and that is created by the angular-chrat.js library.
I do not want to manipulate it through library but using core Javascipt.