0
http(req).success(function(r){
    var test = {};
    test.a = res.a;
    test.b = res.b;
    var array-list = res.z;
    var details = popup.show({
        template : '<div class="row"><div class="row">' +
        '<div class="col col-40"><span>{{test.a}}</span></div>' +
        '<div class="col col-40"><span>{{test.b}}</span></div>' +
        '</div></div><ul class="list"><li class="item" ng-repeat="list in array-list">{{list.a}}</li></ul></div>',
        title :'Some Text',
        scope:$scope,
        buttons:[{
            test:'Close',
            onTap:function(e){
                e.preventDefault();
                details.close();
            }
        }]
    });

Can any one correct me where i caught wrong in implementing Ionic Pop-up with custome template and with ajax response dynamic content.

Burak
  • 5,252
  • 3
  • 22
  • 30
RameshKumar
  • 164
  • 1
  • 16

2 Answers2

0

You have a typo. In Success function. You are getting "r" and you are using "res". Otherwise the code has one more thing missing. Where is your

details.then(function(result){
     //do something here with result
})

Without this the popup wont show up. I GUESS.

Karan Kumar
  • 2,655
  • 19
  • 36
0

try this...

var details = $ionicPopup.show({
            template : '<div class="row"><div class="row">' +
            '<div class="col col-40"><span>{{test.a}}</span></div>' +
            '<div class="col col-40"><span>{{test.b}}</span></div>' +
            '</div></div><ul class="list"><li class="item" ng-repeat="list in array-list">{{list.a}}</li></ul></div>',
            title :'Some Text',
            scope:$scope,
            buttons:[{
                test:'Close',
                onTap:function(e){
                    e.preventDefault();
                    details.close();
                }
Ranendra
  • 21
  • 1
  • 9