2016-03-01 87 views
0

我有幾個鏈接的角材料md-sidenav。右側的主要內容包含我的ui-view。點擊鏈接使用ui-router在主要內容區域打開適當的內容。如何使用ui-router路由到另一個內部站點?

<body ng-app="mainApp" ng-cloak> 
    <div layout="column" style="height:100%;"> 
     <section layout="row" flex> 
     <md-sidenav class="md-sidenav-left md-whiteframe-z2" md-component-id="left" md-is-locked-open=true> 
      <md-content layout-padding layout="column"> 
      <md-button ui-sref="home" class="md-primary">Home</md-button> 
      <md-button ui-sref="map" class="md-primary">Map</md-button> 
      </md-content> 
     </md-sidenav> 
     <md-content flex layout-padding> 
      <!-- Main Content --> 
      <div ui-view></div> 
     </md-content> 
     </section> 
    </div> 
    </body> 

我有另一個網站,是自動生成的與外部工具(生成一個index.html,一束的javascript,圖標,CSS的,等等)。這個輸出是內部託管的,但是生成的代碼是指相對於自身的路徑,而不是我網站的其餘部分。當我嘗試路由到這個index.html時,它因此找不到引用的路徑。

這是我目前的狀態:

.state('map', { 
     url: "/map", 
     templateUrl: "components/map/overviewer/index.html", 
     controller: "MapCtrl" 
    }) 

我找到了一個解決方案,我可以打開網頁,但我無法弄清楚如何我的主要內容部分中打開它。有任何想法嗎?

.state('external', { 
     onEnter: function($window) { 
      $window.open('components/map/overviewer/index.html', '_self'); 
     } 
    }); 

回答

1

使用iframe加載您的內部網站。

在包含iframe的主站點中創建一個「虛擬」組件,並使用ui-route來導航到該虛擬組件。然後將此iframe鏈接到您的內部網站。

相關問題