angularjs - ng-repeat not working with set data structure -
i'm trying use ng-repeat
field set
in javascript https://developer.mozilla.org/es/docs/web/javascript/reference/global_objects/set. tried use values(), keys(), entries() method set ng-repat not working, know way, hack work?
resumed code:
function campaign () { this.site = { type : '', domains : new set() }; }
controller:
.controller('campaignstep1ctrl', ['$scope', 'languages', 'geolocationservice', function ($scope, languages, geolocationservice) { var vm = this; vm.campaign = $scope.campaign; }
html:
<tr class="ui-widget-content ui-datatable-empty-message" ng-repeat="domain in vm.campaign.site.domains"> <td colspan="2">{{domain}}</td> </tr>
note: if use console.log() , print domains attribute, prints, think problem ng-repeat.
this not best solution can make work this:
view:
<p ng-repeat="value in getsetasarr(set)">{{ value }}</p>
controller:
$scope.getsetasarr = function (set) { var arr = []; set.foreach(function (value) { arr.push(value); }); return arr; };
Comments
Post a Comment