Google Maps in modal not showed after two times open - Ionic

前端 未结 2 619
花落未央
花落未央 2021-01-22 01:29

I\'m created a Google Map in a modal view, once I\'m open that modal, the map was showed. Then, I clicked nav-back-button to go to main page. After that I tried to open the moda

2条回答
  •  余生分开走
    2021-01-22 01:54

    Moving the code to a mainCtrl instead of HomeTabCtrl resolve the issue:

    check this CodePen

    HTML:

    
    ...
    

    JS:

    .controller('mainCtrl', function($scope, $ionicModal, $compile) {
    // the code previously in HomeTabCtrl
    }
    

    I noticed that you are using an old version of Ionic and also old-style directives. Here is a version updated of Ionic app using Angular-google-maps:

    http://plnkr.co/edit/n4Qr3OMcGIb5uU28xISU?p=preview

提交回复
热议问题