A
A
Alexander Murashkin2015-10-29 21:50:57
Angular
Alexander Murashkin, 2015-10-29 21:50:57

How to create a copy of the angularjs material element and paste it into the DOM?

It is necessary to create a copy of the inputs when clicking on the button, but with other models like adress -> adress1, etc. And embed it in the dom

<div class="precard-title">Филиал</div>
                  <md-card class='md-padding md-margin filial'>
                    <md-input-container flex>
                        <label>Адрес</label>
                        <input ng-model="adress">
                      </md-input-container>
                      <md-input-container flex>
                        <label>Телефон</label>
                        <input ng-model="phone">
                      </md-input-container>
                      <md-input-container flex>
                        <label>Расписание</label>
                        <input ng-model="plan">
                      </md-input-container>
                  </md-card>
                  <md-button class="md-primary md-raised" ng-click="addFil()">Добавить филиал</md-button>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2015-10-29
@alex_romanov116

Make an array of objects, and output through NG-REPEAT .. and therefore you will add by push
and <input ng-model="plan">not the best practice .. better
<input ng-model="adress.plan">

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question