作成次世代オーダーハブ標準のAngularリポジトリを使用するアプリケーション
標準の Angular リポジトリを使用すると、Angular UI アプリケーションに対してよりシンプルで従来的なアプローチが提供されます。 独立した UI アプリケーションを作成し、依存関係やコード共有をあまり行わずに高速にコーディングしたい場合は、このアプローチを使用します。
このタスクについて
この手順では、次世代オーダーハブアプリケーションを作成し、基本的な Angular リポジトリに保存します。
手順
npm uninstall -g @buc/schematics
npm install -g ./lib/buc/schematics/schematics-v3latest.tgz
ng new --collection=@buc/schematics \
--module-name=<name-of-the-module> \
--module-short-name=<the-short-name-for-the-module> \
--prefix=<selector-prefix> \
--mode=on-prem
注記:のng newコマンドには--mode=on-premパラメータ。
回路図は次のオプションをサポートしています。
- --skip-git
- このオプションは初期化しませんGitHubリポジトリ。 デフォルトは false です。
- --commit
- このオプションには初期GitHubリポジトリのコミット情報。 デフォルトは true です。
- --module-name
- これらの必須オプションはモジュールの名前です。 例えば、 buc-アプリ設定。
- --module-short-name
- モジュールの短い名前。 モジュール名にダッシュが含まれている場合、短縮名は最後のダッシュの後のテキストにする必要があります。 たとえば、モジュールがbuc-アプリ設定モジュールの短縮名は設定。
- --prefix
- 生成されたコンポーネントに使用する HTML セレクター。 デフォルトはブック。
- --mode
- このオプションを設定するオンプレミス適用可能なコードを生成する次世代オーダーハブ。
Angular アプリケーションを作成するコマンドを実行する次の例を参照してください。
ng new --collection=@buc/schematics --module-name=custom-angularrepo
--module-short-name=angularrepo --prefix=angularrepo --mode=on-prem
注記:次のメッセージのようなエラーが発生した場合は、エラーを無視しても問題ありません。 これらのエラーは、注文ハブ。
エラー: エントリポイント @carbon/icons-angular/ のコンパイルに失敗しました
./om-compose.sh start orderhub
docker exec om-orderhub-base bash -c 'mkdir -p /opt/app-root/src/shell-ui/assets/custom'
docker cp <orderhub-code>/shell-ui/assets/dev/. om-orderhub-base:/opt/app-root/src/shell-ui/assets/custom/
yarn start --host=localhost
注記:次のメッセージが表示されます。
"** Angular Live Development Server は localhost:<port> でリッスンしています。 ブラウザを開いてhttps://localhost:<ポート>/<モジュール>/<ルート> **"このメッセージは無視してください。
<div class="app-root-custom-angularrepo">
<div class="app-region-body">
<div class="app-body-content" *ngIf="isBucTenantChangeSuccess || isBucJwtRefreshSuccess">
<router-outlet></router-outlet>
</div>
<div *ngIf="isInitialState" class="app-loading">
<div ibmCol>
<buc-loading [isActive]="isInitialState"></buc-loading>
</div>
</div>
Hello World!
</div>
</div>
注記:証明書を承認するには、
https://localhost:4000
の代わりにhttps://bucgenerichost:4000
。