angularjs - ionic modal scope not working using $ionicModal.fromTemplateUrl() -


i trying open ionic modal after logging in app. modal opening fine along data. problem when attaching ng-click event corrosponding ok or cancel button, not working.the function not called.maybe there problem scope. cant figure out why..

this controller  $scope.dummydata = networkdisplay.gethospitals();          console.log($scope.dummydata.invitetonetwork);          if ($scope.dummydata.invitetonetwork) {            $ionicmodal.fromtemplateurl('templates/network/modal.html', {              scope: $scope,              animation: 'slide-in-up'            }).then(function(modal) {                $scope.modal = modal;                $scope.modal.show();                console.log($scope.dummydata);                $scope.ok = function(data) {                  (var = 0; < data.length; i++) {                    if (data[i].checked === true)                      hospitalsnetwork.set(data[i]);                    //  console.log(data[i].checked);                  }                    $scope.modal.remove();                  $state.go('tab.networks');                };                  $scope.cancel = function() {                  $scope.modal.remove();                  $state.go('tab.dashboard');                };
this modal.html  <ion-view>    <ion-content>      <div class="card">        <p class="padding">do following hospitals added network?</p>        <!--<ul class="list">          <li class="item item-checkbox" ng-repeat="hospital in dummydata.invitetonetwork">            <label class="checkbox">              <input type="checkbox">            </label>            flux capacitor          </li>        </ul>-->        <div class="list">          <ion-checkbox ng-repeat="hospital in dummydata.invitetonetwork" ng-model="hospital.checked">            {{hospital.name}}          </ion-checkbox>        </div>        <!-- <div class="modal-footer"> -->        <button type="button" ng-click="ok(dummydata.invitetonetwork)">ok</button>        <button type="button" ng-click="cancel()">cancel</button>        <!-- </div> -->      </div>    </ion-content>  </ion-view>

i stuck in same , figured out it not working on ionic app working on ios emulator. can't able test ionic modal on ionic app till ionic team fix issue.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -