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:

Detect AdBlock with JavaScript in my browser

30-07-2017 AdBlock javascript detect

How to submit form using javascript or jquery.

16-04-2017 javascript jquery submit form

Sanitization in java sript

14-03-2017 sanitization java script

Convert Time 24 hrs to 12 hrs format In javascript

12-03-2017 date javascript 12hrs convert

Change datepicker display format

06-03-2017 datepicker angular js