Sorry for having no direct reply, but is what you want to do really 
necessary?
I mean: How does the implementation of textValue look like?
Can't you store the values in an object hashed by textelementGuid and just 
reference it like ng-model="textValues[textelementGuid]"

If you can't do that and really need/want to stick to the getter/setter 
approach:
One option would be to somehow create a closure for each textarea that is 
already bound to the guid and reference the closure in the model,
somehow like 
<textarea ng-model="myTextValue" ng-init="myTextValue = 
bind(textelementGuid)" ...></textarea>


and 
$scope.bind = function(guid) {
   return angular.bind($scope, $scope.textValue, guid)
}
I'd like to try that , but I am too lazy to create a plunkr. ;-)


On Monday, September 29, 2014 10:55:07 AM UTC+2, Michael Kriegel wrote:
>
> Hi,
>
> I am fairly new to AngularJs. I started using the getter / setter feature. 
> Now I have following situation:
>
> <table class="treenode" ng-repeat="(textelementGuid, textelement) in 
> textgroup.textelements">
> <tr><td>
>   <textarea ng-model="textValue" class="value" value="" wrap="off"
> ></textarea>
> </td></tr></table>
>
> Now in the controller in the function textValue I want to know the 
> textelementGuid which belongs to the textarea:
>
> ...
> $scope.textValue = function(aNewValue){
>   //how to get the textelementGuid for which the textarea was 
> instantiated in ng-repeat???
> };
>
> I hope anybody can help me with this.
>
> Greetings, Michael
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to