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:

How to make an http request in node js

14-03-2017 http module node js

Convert Time 24 hrs to 12 hrs format In javascript

12-03-2017 date javascript 12hrs convert

Filters for convert text to camel case in Angular Js

05-03-2017 angularjs camelcase filters

How to get drop down value when drop down change using javascript

27-02-2017 onchange events dropdown javascript functions

Email validation regular expression in javascript

22-02-2017 email validation regex