On 19 November 2012 21:52, Mario J. Barchéin
Hello.
I have some code that makes this inside an HTML partial:
...
...
...
This is made in a complex inclusion of partials via ng-include. These partials use the "selection" attribute created into the scope with ng-init. This works fine, but if I change in the controller $scope.payment using $scope.payment=new Payment(), selection doesn't get redefined, because ng-init evaluates only once and my payment process breaks.
Then, I have done this:
<div>
{{ selection=payment.category[
categories.id] ; "" }} // note the empty string at the end
...
...
This makes selection always have a reference to the correct payment property, even if I change $scope.payment the same way as before, but it seems an ugly way of doing it. The empty string in the expression is the value returned to the template, so it shows nothing in the same way as ng-init.
Is it fine or you have some better idea of accomplishing this?
Thanks.
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+u...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular?hl=en.