Migrating new 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 migrates your new applications in a new standard Angular repository in the next-generation Order Hub environment.
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
- This required option is 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 name 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 creates the new 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/
Note: Do not copy the module package.json file from the existing
customization.
Note: Do not copy the src/environments folder from the existing
customization.
./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.
Note: To accept certification, it is now
https://localhost:4000
instead of
https://bucgenerichost:4000
.