2
我想在路由到配置文件之前立即從遠程服務獲取所有數據。如何在AngularDart中導航之前獲取數據?
我發現打字稿版本角度有解決以幫助在導航前獲取數據。但我在Dart版本中找不到任何示例(angular2:^ 3.0.0)。
@RouteConfig(const [
const Route(path: '/', name: 'Home', component: HomeComponent, useAsDefault: true]),
const Route(path: '/profile', name: 'Profile', component: ProfileComponent),])
class AppComponent implements OnInit{
}
任何人都知道如何使用Dart來處理它?
Angular.dart中的當前路由器沒有「Resolve」。取決於你試圖完成什麼,可能有不同的解決方法。還有人提到Angular.dart的新路由器正在進行中(可能還需要一段時間) –
Tks爲您的答覆。我想在呈現ProfileComponent之前獲取所有必需的數據,因爲當瀏覽器呈現所有靜態內容並且ProfileComponent中的某個子組件仍在等待異步Http結果時,我嘗試阻止飽和。 我希望我的UI顯示整體像服務器端渲染一樣。 –