0

I'm having trouble with hidden input. I have this html:

<form ng-controller="FormCtrl as a" ng-submit="a.something(a.form)" novalidate>
   <input type="hidden" ng-model="a.form.unitPrice" ng-init="a.form.unitPrice = product.prices[0].price" value="{{a.form.option}}">
...

Value of a.form.unitPrice is dinamically changing. Controller:

this.addToCart = function(a) {
   console.log(a);
   console.log ($scope.a.form.unitPrice);
};
dontHaveName
  • 1,899
  • 5
  • 30
  • 54

1 Answers1

0

Try calling

$scope.$digest();

I've noticed also that angular is not updating not visible elements.

Arnold Roa
  • 7,335
  • 5
  • 50
  • 69