Angular.js
≥ 1.3
Ever tried bind a future to a ng-model
? At least me and someone else on Stackoverflow did and got an unstatisfying result/answer (“don't”). This module is similar to my answer on SO.
Bind a ngResource
to a ngModel
. Works with other futures, that have a $promise
and a $resolved
property, too. Works best with an own $formatter
/$parser
directive.
<textarea is-future
ng-model="value1" ></textarea>
One directive that ensures that the $viewValue
of the model is updated when the $resource
promise is resolved. Just hook it onto your input field.
Whith this directive you can supply a value for the time while your promise is unresolved (otherwise you'll get an empty object in most cases which is barely desiderable)
<textarea future-pending-value="['downloading things']"
is-future
ng-model="value1" ></textarea>
Welcome!
This project is licensed under the MIT license.