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:

Convert and download html to pdf without saving file

28-10-2018 node js convert html to pdf pdf download pdf without saving

File Upload Using Angular Js and Node Js

28-05-2018 AngularJs Node js file upload multer module

Use java script file client side and server side at a time in node js

30-07-2017 node js include call javascript

How to redirect one page to another page in php

20-03-2017 redirect php

Get Unique values from array/object in javascript

19-02-2017 javascript unique remove repeated values from array