I'm getting date like this 09/29/2017 and I want to replace / in - using this in angularjs
$scope.newString = $scope.date.replace("/","-");
But it generate a date like this 09-29/2017 and doesn't replace whole / to - . How can I replace all / to -
Can anyone help me to get this. Any help will be appreciated.
Thanks in advance.