I am started to work with Angular.js, I want to replace HTTP:// of any URL in a simple string like 'hey', I didn't get any relevant solution.
I'd be grateful for your response.
try this. http://www.w3schools.com/jsref/jsref_replace.asp
var str = "Visit Microsoft!";
var res = str.replace("Microsoft", "W3Schools");
I got my answer here is the controller code
function ListCtrl($scope, $http,Project) {
$http.get('/project').success(function(data){
for(var i=0;i<data.length;i++){
data[i].site=data[i].site.replace('http://','Hey');
}
$scope.projects=data;
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With