久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<i id='OOolB'><tr id='OOolB'><dt id='OOolB'><q id='OOolB'><span id='OOolB'><b id='OOolB'><form id='OOolB'><ins id='OOolB'></ins><ul id='OOolB'></ul><sub id='OOolB'></sub></form><legend id='OOolB'></legend><bdo id='OOolB'><pre id='OOolB'><center id='OOolB'></center></pre></bdo></b><th id='OOolB'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='OOolB'><tfoot id='OOolB'></tfoot><dl id='OOolB'><fieldset id='OOolB'></fieldset></dl></div>

    <legend id='OOolB'><style id='OOolB'><dir id='OOolB'><q id='OOolB'></q></dir></style></legend>
  • <small id='OOolB'></small><noframes id='OOolB'>

      <bdo id='OOolB'></bdo><ul id='OOolB'></ul>
      1. <tfoot id='OOolB'></tfoot>

      2. 在渲染“頁面"之前獲取數(shù)據(jù)異步

        Get data async before a `Page` gets rendered(在渲染“頁面之前獲取數(shù)據(jù)異步)
        <i id='AAGWy'><tr id='AAGWy'><dt id='AAGWy'><q id='AAGWy'><span id='AAGWy'><b id='AAGWy'><form id='AAGWy'><ins id='AAGWy'></ins><ul id='AAGWy'></ul><sub id='AAGWy'></sub></form><legend id='AAGWy'></legend><bdo id='AAGWy'><pre id='AAGWy'><center id='AAGWy'></center></pre></bdo></b><th id='AAGWy'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='AAGWy'><tfoot id='AAGWy'></tfoot><dl id='AAGWy'><fieldset id='AAGWy'></fieldset></dl></div>
          • <bdo id='AAGWy'></bdo><ul id='AAGWy'></ul>

            <tfoot id='AAGWy'></tfoot>
                <tbody id='AAGWy'></tbody>

              <small id='AAGWy'></small><noframes id='AAGWy'>

                  <legend id='AAGWy'><style id='AAGWy'><dir id='AAGWy'><q id='AAGWy'></q></dir></style></legend>
                  本文介紹了在渲染“頁面"之前獲取數(shù)據(jù)異步的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  在渲染 Page 之前獲取數(shù)據(jù)異步的正確方法是什么?

                  What is the correct way to get data async before a Page gets rendered?

                  Angular2 建議使用 @CanActivate 裝飾器.可悲的是,這不適用于 Ionic2,至少不適用于我和 其他

                  Angular2 suggests the @CanActivate decorator as far as I understand it. Sadly this is not working with Ionic2, at least not for me and for others

                  顯然 Ionic2 使用 @CanActivate 裝飾器 見但它沒有記錄,我無法弄清楚它到底做了什么.

                  Apparently Ionic2 does something with the @CanActivate decorator, see But its not documented and i can't figure out what it does exactly.

                  盡管如此 這家伙指出應該使用 無論如何,由于離子緩存,離子視圖狀態(tài).他的例子是這樣的:

                  Nevertheless this guy points out one should use Ionics View States instead anyways, due to ionics caching. His example looks like this:

                    onPageWillEnter() { 
                        return this._service.getComments().then(data => this.comments = data);
                    }
                  

                  看起來他希望 Ionic 考慮返回的承諾,但是 快速瀏覽 離子源顯示(至少我是這么認為的)返回值被忽略.因此,不能保證在頁面呈現(xiàn)之前 會解決承諾.這是一個帶有 onPage* 的 示例,以及它沒有按需要/預期執(zhí)行的原因.

                  Which looks like he is expecting Ionic to consider the returned promise, but a quick glance a Ionics sources reveals (at least I think so) that the returned value is ignored. Hence there is no guarantee that the promise gets resolved before the page gets rendered. Here is an example with onPage* and how it does not perform as needed/expected.

                  所以我迷路了,如何完成這個簡單的任務?

                  So I'm lost, how does one achieve this simple task?

                  在第一個鏈接中,建議在導航到頁面之前解析數(shù)據(jù),這會增加被調(diào)用者知道頁面需要哪些數(shù)據(jù)的負擔.在我看來,這不是一個選擇.

                  In the first link, it was suggested to resolve the data before navigating to the page, which burdens the knowledge which data is needed for the page on the callee. This is not an option in my opinion.

                  *添加反例

                  推薦答案

                  對于在使用 Ionic 2 時對 Stackoverflow 進行限制頁面訪問的任何人來說,Ionic 推薦的生命周期事件似乎是 ionViewCanEnter.

                  For anyone crawling Stackoverflow about restricting page access when using Ionic 2, it looks like Ionic's recommended lifecycle event to tap into is ionViewCanEnter.

                  來自文檔:

                  ionViewCanEnter 在視圖進入之前運行.這可以用作經(jīng)過身份驗證的視圖中的一種守衛(wèi)",您需要在視圖進入之前檢查權限.

                  ionViewCanEnter Runs before the view can enter. This can be used as a sort of "guard" in authenticated views where you need to check permissions before the view can enter.

                  http://ionicframework.com/docs/v2/api/navigation/NavController/

                  這篇關于在渲染“頁面"之前獲取數(shù)據(jù)異步的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Use IScroll in Angular 2 / Typescript(在 Angular 2/Typescript 中使用 IScroll)
                  anime.js not working in Ionic 3 project(Anime.js 在 Ionic 3 項目中不起作用)
                  Ionic 3 - Update Observable with Asynchronous Data(Ionic 3 - 使用異步數(shù)據(jù)更新 Observable)
                  Angular 2: file not found on local .json file(Angular 2:在本地 .json 文件中找不到文件)
                  In Ionic 2, how do I create a custom directive that uses Ionic components?(在 Ionic 2 中,如何創(chuàng)建使用 Ionic 組件的自定義指令?)
                  Use ViewChild for dynamic elements - Angular 2 amp; ionic 2(將 ViewChild 用于動態(tài)元素 - Angular 2 amp;離子2)

                  • <legend id='zD2XM'><style id='zD2XM'><dir id='zD2XM'><q id='zD2XM'></q></dir></style></legend>

                      <tfoot id='zD2XM'></tfoot>

                      <small id='zD2XM'></small><noframes id='zD2XM'>

                            <bdo id='zD2XM'></bdo><ul id='zD2XM'></ul>
                              <tbody id='zD2XM'></tbody>
                            <i id='zD2XM'><tr id='zD2XM'><dt id='zD2XM'><q id='zD2XM'><span id='zD2XM'><b id='zD2XM'><form id='zD2XM'><ins id='zD2XM'></ins><ul id='zD2XM'></ul><sub id='zD2XM'></sub></form><legend id='zD2XM'></legend><bdo id='zD2XM'><pre id='zD2XM'><center id='zD2XM'></center></pre></bdo></b><th id='zD2XM'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='zD2XM'><tfoot id='zD2XM'></tfoot><dl id='zD2XM'><fieldset id='zD2XM'></fieldset></dl></div>
                            主站蜘蛛池模板: 在线视频日韩 | 免费观看a级片 | 亚洲久热| 日韩成人影院 | 亚洲天堂影院 | 日韩亚洲在线 | www.男人天堂 | 国产欧美日韩一区二区三区 | 自拍偷拍中文字幕 | 日韩香蕉视频 | 久久久亚洲精品视频 | 国产丝袜av | 狠狠狠干 | 国产三级成人 | 欧美性猛交一区二区三区精品 | 亚洲一级特黄 | 欧美国产日韩一区二区 | 成人永久免费视频 | 欧美网站在线观看 | 免费黄色一级片 | 伊人9999| 黄色免费在线视频 | 国产乱淫片视频 | 五月婷婷av | 97久久精品人人澡人人爽 | 黑人精品xxx一区一二区 | 欧美精品久久99 | 黄色大片免费在线观看 | 黄色片中文字幕 | 日韩综合精品 | 毛片www | 丁香六月综合 | 欧美日韩高清 | 这里只有精品视频在线观看 | 黄色小视频在线免费观看 | 久久伊人av | 日韩理论在线 | 精品国产一二三 | 黄色免费毛片 | 成人毛片网 | 欧美18免费视频 |