hi fox,
i have a problem in a list-card item with an ng-click event.
her my code:
Html Template:
< ion-list class="card">
<ion-item ng-repeat="emergencyProceduresItem in emergencyProceduresList" class="item-icon-right" type="item-text-wrap" ng-click="openModal({{emergencyProceduresItem}})" href="#">
<h3>
{{emergencyProceduresItem.title}}<br/>
<i class="icon ion-chevron-right icon-accessory"></i>
</h3>
</ion-item>
</ion-list>
Controller:
$scope.openModal = function (selectedEmergencyProcedure) {
$scope.selectedItem = selectedEmergencyProcedure;
if ($scope.modal) {
$scope.modal.show();
} else {
$ionicModal.fromTemplateUrl('app/views/modal-emergencyProcedure.html', {
scope: $scope
}).then(function (modal) {
$scope.modal = modal;
$scope.modal.show();
});
}
};
$scope.closeModal = function () {
$scope.modal.hide();
};
$scope.$on('$destroy', function () {
$scope.modal.remove();
});
});
Now the my problem. By first Click on Item the Modal Dialog not open. When i go back and click again it run's perfect.
Do you have an idear what is the Problem?
Greeting Sebastian