i think you are getting this result because your API controller is returning a string and not an array of strings.
so when the angular gets "john" and you to a repeat it is looping through the characters, and that is what gives you the length 4
if instead you API controller returns an array (even just of one name) the angular will get ["john"] and that is a single element, so should just show the single name.
Back Office ng-repeat repeats itself
I created a simple Back Office datatype with a js controller, resource,html, manifest and c# controller but the ng-repeat fires twice.
html:
js controller:
js resource
})
The BackOfficeApi/getName just returns a simple string ("John")
The response.data contains the correct data ("John") and the same goes for $scope.people but the ng-repeat indicates the people.length is 4.
One suggestion I have seen is that the angular library is being called multiple times but not sure if that is the case.
I have created similar in previous Umbraco versions so wondering if it is something to do with V8.
Hi Stephen,
i think you are getting this result because your API controller is returning a string and not an array of strings.
so when the angular gets
"john"
and you to a repeat it is looping through the characters, and that is what gives you the length 4if instead you API controller returns an array (even just of one name) the angular will get
["john"]
and that is a single element, so should just show the single name.Hi thanks. That makes sense. I'll check it out.
is working on a reply...