I created an angular filter called 'strLimit' to restrict the number of characters in a string:
mod.filter('strLimit', ['$filter', function ($filter) {
return function (input, limit) {
if (!input) return;
if (input.length <= limit) {
return input;
}
return $filter('limitTo')(input, limit) + '...';
};
}]);
When I use this filter along with ng-bind-html, sometimes it cuts off the output like:
"This is a dummy string &ntil..."
In PHP, I could solve this issue by using mb_substr instead of substr. Now I need to find a way to correct this behavior in Angular.