jquery - AngularJS ng-repeat: Change Array -
i want change categoryalpha
different value (say, categorybeta
) in following html + angularjs:
<div ng-repeat="x in categoryalpha | limitto:quantity"> <previews></previews> <hr /> </div>
since ng-repeat isn't normal attribute, don't think can change through jquery attr()
. solution regex, or there angular/jquery method can change value categoryalpha
?
thanks in advance.
you can example create function return collection ng-repeat , assign scope. like:
// in controller $scope.getcategory = function getcategory() { return somecondition ? categoryalpha : categorybeta; };
and in markup:
<div ng-repeat="x in getcategory() | limitto:quantity"> <previews></previews> <hr /> </div>
Comments
Post a Comment