P
P
Pavel Prosvetov2015-03-10 15:43:00
Angular
Pavel Prosvetov, 2015-03-10 15:43:00

How to move data with ng-repeat to another location?

It is necessary, when bypassing in ng-repeat (if itemTwo.type == inBottom), to move the data to work with them to another place (for example, in div class=''bottom'). The same ng-repeat will occur with this data in the future Is it possible to make some directory so that it calls itself, otherwise the nesting can be unlimited
.

<div data-ng-repeat="(index, item) in items" >
     <div data-ng-repeat="(indexTwo, itemTwo) in items[index]">
           <div ng-switch="itemTwo.type">
                  <div ng-switch-when="inBottom">
                      ????????
                  </div >
                   <div ng-switch-default>
                         {{itemTwo.name}}
                   </div >
            <div >
    <div >
</div >
<div class='bottom'>
</div >

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2015-03-10
Protko @Fesor

everything that is at least somewhat more complicated than simple ng-show / ng-hide, or simple loop bypasses, most likely should be done not in templates but in the controller.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question