Filter for replace text in Angular Js

05-03-2017 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:

File Upload Using Angular Js and Node Js
28-05-2018 AngularJs Node js file upload multer module
Detect AdBlock with JavaScript in my browser
30-07-2017 AdBlock javascript detect
How to change background color and color to the text using javascript
27-02-2017 css javascript colors
How to set or update or push the values into Object in javacript
27-02-2017 javascript set update push object
Email validation regular expression in javascript
22-02-2017 email validation regex