乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      SAP UI5應(yīng)用入口App.controller.js是如何被UI5框架加載的?

       汪子熙 2019-06-26

      首先在UI5應(yīng)用的manifes.json里,定義了UI5應(yīng)用的入口視圖為App:

      調(diào)試器里的pending數(shù)組的兩個(gè)元素:

      實(shí)際上對(duì)應(yīng)了我在App.controller.js里定義的兩個(gè)依賴:

      而aModules數(shù)組里的兩個(gè)對(duì)象,就是BaseController和JSONModel模塊加載后的實(shí)例:

      有經(jīng)驗(yàn)的開發(fā)人員從這些函數(shù)列表bindProperty, bindTree, dataLoaded,getJSON等就能得知這個(gè)實(shí)例是JSONModel的實(shí)現(xiàn)。

      這個(gè)注釋寫的比較清楚,如果factory函數(shù)返回不為false的值,則該值需要被賦到module的exported字段去。
      from https://github.com/amdjs/amdjs-api/blob/master/AMD.md
      // "If the factory function returns a value (an object, function, or any value that coerces to true),
      // then that value should be assigned as the exported value for the module."

      UI5模塊的加載器:ui5loader.js

      那么我們應(yīng)用代碼的controller里到底return什么值呢?即BaseController調(diào)用extend方法后的返回值。

      這個(gè)返回值在BaseController的基礎(chǔ)上,包含了我們應(yīng)用程序自定義的onInit方法。

      至此,App.controller.js這個(gè)模塊就加載完成了。
      執(zhí)行ready之前:

      ready函數(shù)的職責(zé)就是把模塊實(shí)例的state設(shè)置成Ready,settled設(shè)置成true:

      要獲取更多Jerry的原創(chuàng)文章,請(qǐng)關(guān)注公眾號(hào)"汪子熙":

        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評(píng)論

        發(fā)表

        請(qǐng)遵守用戶 評(píng)論公約

        類似文章 更多