Filter for replace text in Angular Js

filter
replace
angular js

By using below filter we will replace the text in angular js

angular.module('surgi')
.filter('ReplaceBreak', function() {
  return function(input) {
    input = input || '';
    html = '';
    var br_arr = input.split('<br>');
    for(var i=0;i<br_arr.length;i++){
    	html += br_arr[i]+', ';
    }
    html = html.substring(0, html.length - 2);
    html = html.replace(/,\s*$/, "");
    return html;
  };
});

 

 

 

You might also like:

Compare the Triplets | Javascript | hackerrank.com

07-05-2020 hackerrank.com

Convert Time 24 hrs to 12 hrs format In javascript

12-03-2017 date javascript 12hrs convert

How to convert html to pdf in Node js

12-03-2017 pdf convert html node js

Get next date from given date in javascript

06-03-2017 date javascript next date

Email validation regular expression in javascript

22-02-2017 email validation regex