Angular2 calling custom function after ngSwitch new view is created

后端 未结 3 1509
粉色の甜心
粉色の甜心 2020-11-30 14:23

I am creating a small app using Angular2+Ionic2. In this app I want initialise google-map into view segment when user

3条回答
  •  隐瞒了意图╮
    2020-11-30 15:05

    You can also call a function when ion-segment is changed.

    
    

    and in your component a function like

    updatePage(homeSegment) {
      if (homeSegment === 'map') {
        this.loadMap();
      }
    }
    

    Maybe this helps someone.

提交回复
热议问题