久久久久久久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. 在渲染“頁(yè)面"之前獲取數(shù)據(jù)異步

        Get data async before a `Page` gets rendered(在渲染“頁(yè)面之前獲取數(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>
                  本文介紹了在渲染“頁(yè)面"之前獲取數(shù)據(jù)異步的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  在渲染 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 裝飾器 見(jiàn)但它沒(méi)有記錄,我無(wú)法弄清楚它到底做了什么.

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

                  盡管如此 這家伙指出應(yīng)該使用 無(wú)論如何,由于離子緩存,離子視圖狀態(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);
                    }
                  

                  看起來(lái)他希望 Ionic 考慮返回的承諾,但是 快速瀏覽 離子源顯示(至少我是這么認(rèn)為的)返回值被忽略.因此,不能保證在頁(yè)面呈現(xiàn)之前 會(huì)解決承諾.這是一個(gè)帶有 onPage* 的 示例,以及它沒(méi)有按需要/預(yù)期執(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.

                  所以我迷路了,如何完成這個(gè)簡(jiǎn)單的任務(wù)?

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

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

                  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.

                  *添加反例

                  推薦答案

                  對(duì)于在使用 Ionic 2 時(shí)對(duì) Stackoverflow 進(jìn)行限制頁(yè)面訪問(wèn)的任何人來(lái)說(shuō),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.

                  來(lái)自文檔:

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

                  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/

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

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

                  相關(guān)文檔推薦

                  Use IScroll in Angular 2 / Typescript(在 Angular 2/Typescript 中使用 IScroll)
                  anime.js not working in Ionic 3 project(Anime.js 在 Ionic 3 項(xiàng)目中不起作用)
                  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 用于動(dòng)態(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| 狠狠干在线 | 欧美簧片 | 国产精品国产三级国产播12软件 | 欧美不卡在线 | 国产成人一区在线 | 国产精品久久久久久亚洲调教 | 黄网站免费在线看 | 久久综合伊人 | 成人免费观看男女羞羞视频 | 精品自拍视频在线观看 | 日本三级电影在线观看视频 | 中文字幕精品一区久久久久 | 在线观看精品视频网站 | 中文字幕国产在线 | 91精品国产91久久久久游泳池 | 亚洲精品成人在线 | 日韩欧美在线不卡 | 国产高清视频在线观看播放 | 日本在线网址 | 亚洲视频免费 | 色综合九九| 中文字幕在线视频精品 | 国产在线视频三区 | 精品一区二区三区四区五区 | 女人av| 久久精品久久精品 | 91精品国产综合久久精品 | 国产一区二区三区四 | 国产视频在线一区二区 | 国产精品精品视频一区二区三区 | 99久久视频 | 欧美精品一二区 | 欧美日韩精品专区 | 色一级|