Angularjs 单击“刷新已选定选项卡上的iframe”

Angularjs 单击“刷新已选定选项卡上的iframe”,angularjs,iframe,ionic-framework,ionic-view,Angularjs,Iframe,Ionic Framework,Ionic View,我有一个带有tabs模板的Ionic 1.x应用程序,在每个选项卡的每个视图上我都有一个iframe。问题是,当用户在iframe上导航时,如果他再次单击当前选项卡,我想用初始url刷新iframe,这可能吗 我已经在我的tabs.html视图中显示了: <ion-tab title="Home" icon-off="ion-home" icon-on="ion-home" on-select="refresh('home')" href="#/tab/home"> <

我有一个带有tabs模板的Ionic 1.x应用程序,在每个选项卡的每个视图上我都有一个iframe。问题是,当用户在iframe上导航时,如果他再次单击当前选项卡,我想用初始url刷新iframe,这可能吗

我已经在我的tabs.html视图中显示了:

<ion-tab title="Home" icon-off="ion-home" icon-on="ion-home" on-select="refresh('home')" href="#/tab/home">
    <ion-nav-view name="tab-home"></ion-nav-view>
</ion-tab>

谢谢你

我尝试将iframe放入指令中,并在刷新时将其删除,然后将其添加回。@alphapilgrim mm我如何有效地删除指令并将其恢复?以前我从未尝试过将iframe放到指令中,并在刷新时将其删除,然后再将其添加回去。@alphapilgrim mm我如何高效地删除指令并将其恢复?以前从来没有
<ion-view cache-view="false" hide-nav-bar="true" view-title="Dashboard">
  <ion-content overflow-scroll="false">
    <style>
      #contenedor{width: calc( 100% + 0px) ; height: 100%!important; overflow: hidden !important;}
      iframe{width: calc( 100% + 17px) ; height: 100%;}
    </style>
    <div id="contenedor" style="overflow:auto;-webkit-overflow-scrolling:touch">
    <iframe id="iframehome" style="width:100%;height:100%" type="text/html" ng-src="{{direhome | trusted}}"></iframe>
    </div>
  </ion-content>
</ion-view>
.controller('HomeCtrl', function($scope) {
 console.log("homectrl");
 $scope.direhome = "http://google.com/";
  $scope.refresh = function(){
    $window.location.reload(true)
    $state.go($state.current, {}, {reload: true});
  }
})