1

angularjs binding replace filter, trying to do

<td>
<!-- {{invoice.Number}} -->
{{invoice.SAPCLInvoiceNumber.replace("CL","CL - ")}}
</td>

How ever the replace is not working what is the correct syntax for Angular to do this? whats the correct way to do replace?

4
  • 1
    Do it within the controller: $scope.invoice.SAPCLInvoiceNumber = $scope.invoice.SAPCLInvoiceNumber.replace("CL","CL - "); Commented Jan 8, 2018 at 11:06
  • ya try with controller @Waqar Commented Jan 8, 2018 at 11:06
  • you need to covert anularjs to angular code ? Commented Jan 8, 2018 at 11:17
  • Hope you are using angular 1.x. Your syntax looks fine. Could you add more info to the question? What is the input and desired output? Check the value invoice.SAPCLInvoiceNumber in your screen. For more info about the syntax Refer stackoverflow.com/questions/27219097/… Commented Jan 8, 2018 at 11:34

1 Answer 1

0

you can create filter and use it in view :

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.