Creating next-generation Order Hub applications using a standard Angular repository
Using a standard Angular repository provides a simpler more traditional approach to an Angular UI application. Use this approach if you are creating an independent UI application and want to code it fast without much dependency or code sharing.
About this task
This procedure guides you through how to create a next-generation Order Hub application and store it in a basic Angular repository.
Procedure
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
Note: The ng new command requires the --mode=on-prem
parameter.
The schematic supports the following options.
- --skip-git
- This option does not initialize a GitHub repository. The default is false.
- --commit
- This option includes the initial GitHub repository commit information. The default is true.
- --module-name
- These required options are the name of the module. For example, buc-app-settings.
- --module-short-name
- The short name for the module. If the module name has dashes, then the short name must be the text after the last dash. For example, if the module is buc-app-settings, the module short name must be settings.
- --prefix
- The HTML selector to use for generated components. The default is buc.
- --mode
- Set this option to on-prem to generate code that is applicable for next-generation Order Hub.
See the following example of running the command that will create the Angular
application.
ng new --collection=@buc/schematics --module-name=custom-angularrepo
--module-short-name=angularrepo --prefix=angularrepo --mode=on-prem
Note: If you
encounter an error similar to the following message, then you can safely ignore the error. These
errors do not affect the icons that are used by Order Hub.
Error: Failed to compile entry-point @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
Note: You see the following message.
"** Angular Live Development Server is listening on localhost:<port>, open your browser on https://localhost:<port>/<module>/<route> **"You can ignore this message.
<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>
Note: To accept the certificate, it is now
https://localhost:4000
instead of
https://bucgenerichost:4000
.