5
I’m developing an application using Laravel
and AngularJS
. I always found it difficult to format a number to fill with Javascript zeros, so I chose to use Laravel to bring me the field number id
already formatted with zero fill.
But now I’d like to do it for Angularjs, since I’ve realized that its components (or even those that are created) can be highly reused.
What is the step for me to create a function to format the values displayed in view
filling left zeros in Angular?
Is there already a function for this or do I need to create one? How to proceed?
For example:
<tr ng-repeat="u in usuarios">
<td ng-bind="usuario.id|preencher_com_quatro_zeros_a_esquerda"></td>
<td ng-bind="usuario.nome"></td>
</tr>
In the precise example that preencher_com_quatro_zeros_a_esquerda
return me a number formatted with 4 zeros on the left. How to do?
The person who denied could kindly explain what is wrong with the question?
– Wallace Maxters