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:

Check null values in JavaScript?

04-02-2019 JavaScript null check null value

How to upload file by using request module

18-03-2017 request module node js

Change datepicker display format

06-03-2017 datepicker angular js

Filters for convert text to camel case in Angular Js

05-03-2017 angularjs camelcase filters

Call a function every second or 5 seconds in javascript

22-02-2017 setinterval function calling