AlierFramework.js モジュール
モジュールパス: /alier_sys/AlierFramework.js
概要
AlierFramework.js はフレームワーク機能を一括でインポートするためのモジュールで、Alier.View の設定などを行います。
利用方法
Alier.import()
を使ってモジュールをインポートします。通常では、モジュールオブジェクトが持つプロパティを window にコピーするだけです。
const module_object = await Alier.import("/alier_sys/AlierFramework.js");
// Alier.import は非同期関数のため、結果を await する必要がある
Object.assign(globalThis, module_object);
// モジュールの展開方法 1: Object.assign を利用する方法
// Object.defineProperties(globalThis, Object.getOwnPropertyDescriptors(module_object));
// モジュールの展開方法 2: Object.defineProperties と Object.getOwnPropertyDescriptors を利用する方法
効果
- 以下のモジュールがグローバルにインポートされます:
ProtoViewLogic
ViewLogic
AlierCustomElement
ViewElement
ListView
AlierModel
setupModelInterface
setupModelInterfaceFromText
- [副作用] カスタム HTML 要素
<alier-app-view>
が、ViewElement
をコンストラクタとしてwindow
に登録されます - [副作用]
Alier.View
に<alier-app-view>
が設定されます - [副作用]
Alier.View
がdocument.body
の子要素として追加されます
関数
setupAlier()
- Alier フレームワークの初期化を行います。