Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

Add and edit item form same ionic modal form

$
0
0

@Kandros wrote:

Hi, im using ionicModal to push items to an array, using ng-submit to push the object to this array, can somebody please post an example of how to use the same form for edit a clicked item in the list?

I can't understand how to pass the list item instance to the form

$ionicModal.fromTemplateUrl('templates/add-item-modal.html', {  
    scope: $scope,
    animation: 'slide-in-up',
    focusFirstInput: true
  }).then(function (modal) {
    $scope.modal = modal;
  });

    <ion-modal-view>
  <ion-header-bar>
    <h1 class="title">Aggiungi</h1>
  </ion-header-bar>
  <ion-content class="padding">
  <form ng-submit="addItem()">
    <div class="list list-inset">
      <label class="item item-input">
        <input placeholder="Prodotto" ng-model="name" name="name" type="text">
      </label>
      <button class="button button-block button-positive activated">
        Submit
      </button>
    </div>
  </form>
  </ion-content>
</ion-modal-view>

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>