Displaying value in the field formatted by angular-input-masks

Asked

Viewed 681 times

1

Good morning

I’ve successfully used the library: http://assisrafael.github.io/angular-input-masks/ to format value in monetary format.

My problem is that when editing the value does not appear in the field, but the value of the field is filled, when saving it.

How can I display the value when editing ?

Below the code

<script src="angular.min.js"></script>
<script src="angular-locale_pt-br.js"></script>
<script src="masks.js"></script>
<script src="angular-masks-init.js"></script>

<body ng-app="demo">

<input type="text" name="valor" id="valor" value="<?php if(htmlspecialchars($data['valor']) != '') echo htmlspecialchars($data['valor']); else echo $this->error->set_value('price');  ?>" ng-model="money"  ui-money-mask="mdecimals" /> 

I tried to add via pure javascript ( this.value.innerText='') but I imagine it has a way via angular

  • Good afternoon, be more specific, where this variable comes from $data? From a functional example of the problem.

  • Comes from codeigniter is the issue would be a variable $title powered by database

  • Now the value appears because I added the tags of the angular {{ e }} inside the value (I don’t know any other way)

  • But then your problem is with the codeigniter framework? It could be clear friend, your problem is confused.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.