Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

134
Views
Cómo ng-repetir esta fila de la tabla y aumentar el valor de posición de la fila ng-show en lugar de codificar los valores

Estoy trabajando en una función que permite a un usuario crear su propia tabla. Me gustaría refactorizar este código.

Por lo tanto, crea una cantidad de filas en función de las filas máximas que tengo y también aumenta una posición de fila cada vez sin que yo codifique cada fila.

Un ejemplo del código que tengo es el siguiente:

 <div ng-show="components.length != 0"> <h3> Output Preview: <button Class="btn btn-primary" ng-show="components.length > 1" ng-click="hidePositionChange=(hidePositionChange ? false : true)">Change row/order position</button> </h3> <div> <table> <tr> <td ng-repeat="component in components track by $index" ng-show="component.RowPosition == 0">{{component.Text}}{{component.Field}}</td> </tr> <tr> <td ng-repeat="component in components track by $index" ng-show="component.RowPosition == 1">{{component.Text}}{{component.Field}}</td> </tr> <tr> <td ng-repeat="component in components track by $index" ng-show="component.RowPosition == 2">{{component.Text}}{{component.Field}}</td> </tr> ...
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

<div ng-show="components.length != 0"> <h3> Output Preview: <button Class="btn btn-primary" ng-show="components.length > 1" ng-click="hidePositionChange=(hidePositionChange ? false : true)">Change row/order position</button></h3> <div> <table> <tr ng-repeat="componentRow in components track by $index | limitTo: maxItems | orderBy: '+RowPosition'"> <td ng-repeat="component in components | limitTo: 3" ng-if="component.RowPosition == $index">{{component.Text}}{{component.Field}}</td> </tr> </table> </div> </div>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!