Я хотел бы закодировать простой «подтверждающий ионный всплывающий», но у меня была эта проблема, которую я не могу решить. Я уверен, что если вы посмотрите вы найдете его, потому что теперь это, как я был полностью слеп против него ...Ionic PopUp: TypeError: Не удается прочитать свойство «confirm» undefined
TypeError: Не удается прочитать свойство «Подтвердить» неопределенной
Здесь мой код:
// Here is the start of my "directive.js" file, I have one directive and 3 controllers
var myApp = angular.module('app.directives', [])
myApp.directive('activePageHighlight', ['$rootScope', '$state', function($rootScope, $state){
// Something else
}]);
// Here is my controller
myApp.controller('MainCtrl', ['$scope', function ($scope, $ionicPopup, $timeout) {
$scope.info = function(){
var confirmPopup = $ionicPopup.confirm({
// Here I tried to add $scope, but I'm not sure if is it usefull
scope:$scope,
title: 'Consume Ice Cream',
template: '<button class="button button-primary" ng-click="info()">Confirm</button>'
});
confirmPopup.then(function(res) {
if(res) {
console.log('You are sure');
} else {
console.log('You are not sure');
}
});
};
}]);
<div ng-controller="MainCtrl">
<button ng-click="info()" class="calm button-block">Info 1</button>
</div>
Спасибо!
Я такой глупый ... Большое спасибо за то, что работает! :) – Memphis