首先在UI5應用的manifes.json裏,定義了UI5應用的入口視圖爲App:git
調試器裏的pending數組的兩個元素:github
實際上對應了我在App.controller.js裏定義的兩個依賴:json
而aModules數組裏的兩個對象,就是BaseController和JSONModel模塊加載後的實例:api
有經驗的開發人員從這些函數列表bindProperty, bindTree, dataLoaded,getJSON等就能得知這個實例是JSONModel的實現。數組
這個註釋寫的比較清楚,若是factory函數返回不爲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.jsui
那麼咱們應用代碼的controller裏到底return什麼值呢?即BaseController調用extend方法後的返回值。3d
這個返回值在BaseController的基礎上,包含了咱們應用程序自定義的onInit方法。調試
至此,App.controller.js這個模塊就加載完成了。 執行ready以前:對象
ready函數的職責就是把模塊實例的state設置成Ready,settled設置成true:
要獲取更多Jerry的原創文章,請關注公衆號"汪子熙":