$ionicPopup problem


#1

In my application i have a login page and inside a master / detail view

I used IonicPopup in login view like this and all is working

nameApp.controller(‘SignInCtrl’, function ($scope, $state, $ionicPopup) {

    $scope.signIn = function (user) {
        var username = $('#inputusername').val(); // get username
        var password = $('#inputpassword').val(); // get password
        if (username && password) {
        ...
        }
        else{
        var alertPopup = $ionicPopup.alert({
                        title: 'Attection',
                        template: "Checkusername/password",
                        cssClass: 'centered'
                    });
                    alertPopup.then(function (res) {
                        console.log('Thank you');
                    });

Now i’m trying to call popup under my detail view on ng-click function like this

nameApp.controller(‘OfferCtrl’, function ($scope, $http, $stateParams, $ionicPopup, Offers) {

$scope.sendOffer = function ($scope, $state, $ionicPopup) {
    var userid = window.localStorage['userid'];
    var offerValue = $('#valueoffer').val();
    if ((offerValue=='') || (offerValue<=0)){
        var alertPopup = $ionicPopup.alert({
            title: 'Attenction',
            template: "Chech offer value",
            cssClass: 'centered'
        });
        alertPopup.then(function (res) {
            console.log('Thank you');
        });
    }

and here i get $ionicPopup id undefined


#2

is this line correct?

template: "Chech offer value",

#3

template: "some values ",

is just the text to show in the pop up


#4

You look tp be passing in $scope, $ionicPopup and $state - try:
$scope.sendOffer = function () {

}