SlideShare a Scribd company logo
How to Implement Micro Frontend
Architecture using Angular
Framework
Presented by: Unnikrishnan M, Software Engineer
How to Implement Micro Frontend Architecture using Angular Framework
© RapidValue Solutions Confidential 2
Micro Frontend Architecture in Angular
The Angular team introduced the concept of workspaces in their 7.0.0 version which was released in Oct, 2018.
With this update, Angular gave developers a new --create-application flag feature during creation of the
application. By default the --create-application flag will be false.
Example:-
ng new <workspaceName> --create-application=<true/false>
With this addition, the developers now have the option to easily create an application, library or workspace.
The following is the Angular CLI command to generate/modify the files based on schematics:-
ng generate <schematic> [options]
This schematic can take one of the following values:
• appShell
• application
• class
• component
• directive
• enum
• guard
• interceptor
• interface
• library
• module
• pipe
• service
• serviceWorker
• webWorker
Workspace Setup-Basic Angular CLI Commands How to
Implement Micro Frontend Architecture using Angular
Framework
We will be looking into the basic commands used for generating:-
1. Application
ng generate application <name> [options]
ng g application <name> [options]
OPTION DESCRIPTION
--inlineStyle=true|false True -> Includes styles inline in the root component.ts file.
Only CSS styles can be included inline.
False -> External styles file is created and referenced in the root
component.ts file.
Default: false
Aliases: -s
How to Implement Micro Frontend Architecture using Angular Framework
© RapidValue Solutions Confidential 3
--inlineTemplate=true|false True -> Includes template inline in the root component.ts file.
False ->External template file is created and referenced in the root
component.ts file.
Default: false
Aliases: -t
--lintFix=true|false True -> Applies lint fixes after generating the application.
Default: false
--minimal=true|false True -> Creates a bare-bones project without any testing frameworks.
(Used for learning purposes only.)
Default: false
--prefix=prefix A prefix to apply to generated selectors.
Default: app
Aliases: -p
--routing=true|false True -> Creates a routing NgModule.
Default: false
--skipInstall=true|false Skips installing dependency packages.
Default: false
--skipPackageJson=true|false True -> Does not add dependencies to the "package.json" file.
Default: false
--skipTests=true|false True -> Does not create "spec.ts" test files for the app.
Default: false
Aliases: -S
--style=
css|scss|sass|less|styl
File extension/preprocessor to use for style files.
Default: css
--viewEncapsulation=
Emulated|Native|None|ShadowDom
View encapsulation strategy to use in the new app.
2. Component
ng generate component <name> [options]
ng g component <name> [options]
OPTION DESCRIPTION
--changeDetection=Default|OnPush Change detection strategy to use in the new component.
Default: Default
Aliases: -c
--displayBlock=true|false Specifies if the style will contain :host { display: block; }.
Default: false
Aliases: -b
--export=true|false True -> Declaring NgModule exports this component.
Default: false
--flat=true|false True -> Creates the new files at the top level of the current project.
Default: false
How to Implement Micro Frontend Architecture using Angular Framework
© RapidValue Solutions Confidential 4
--inlineStyle=true|false True -> Includes styles inline in the root component.ts file.
Only CSS styles can be included inline.
False -> External styles file is created and referenced in the root
component.ts file.
Default: false
Aliases: -s
--inlineTemplate=true|false True -> Includes template inline in the root component.ts file.
False ->External template file is created and referenced in the root
component.ts file.
Default: false
Aliases: -t
--lintFix=true|false True -> Applies lint fixes after generating the application.
Default: false
--module=module Declaring NgModule.
Aliases: -m
--prefix=prefix Prefix to apply to the generated component selector.
Aliases: -p
--project=project Name of the project.
--selector=selector HTML selector to use for this component.
--skipImport=true|false True -> Does not import this component into the owning NgModule.
Default: false
--skipSelector=true|false True -> Specifies if the component should have a selector.
Default: false
--skipTests=true|false True -> Does not create "spec.ts" test files for the new component.
Default: false
--style=
css|scss|sass|less|styl
File extension or preprocessor to use for style files.
Default: css
--type=type Adds a developer-defined type to the filename, in the format
"name.type.ts".
Default: Component
--viewEncapsulation=
Emulated|Native|None|ShadowDom
View encapsulation strategy to use in the new component.
Aliases: -v
3. Library
ng generate library <name> [options]
ng g library <name> [options]
OPTION DESCRIPTION
--entryFile=entryFile Path in which the library's public API file is created, relative to the workspace
root.
Default: public-api
--lintFix=true|false True -> Applies lint fixes after generating the library.
Default: false
How to Implement Micro Frontend Architecture using Angular Framework
© RapidValue Solutions Confidential 5
--prefix=prefix Prefix to apply to generated selectors.
Default: lib
Aliases: -p
--skipInstall=true|false True -> does not install dependency packages.
Default: false
--
skipPackageJson=true|false
True -> Does not add dependencies to the "package.json" file.
Default: false
--skipTsConfig=true|false True -> Does not update "tsconfig.json" to add a path mapping for the new
library. The path mapping is needed to use the library in an app, but can be
disabled here to simplify development.
Default: false
How to Implement Micro Frontend Architecture using Angular
Framework
The basic idea is to create an application that has the following characteristics, incorporating the new feature. The
outline is as follows:-
1. Create a workspace named Next.
2. It has 2 projects named - User Management, Login.
3. It has a library named apiCall which is used across the 2 projects.
Let's start creating it:-
Step 1
Open git bash in the desired folder location.
Type in:-
ng new Next --create-application=false;
Dive inside the Next folder. The created project structure is as follows:-
WORKSPACE
CONFIG FILES PURPOSE
.editorconfig Configuration for code editors.
.gitignore Specifies intentionally untracked files that Git should ignore.
How to Implement Micro Frontend Architecture using Angular Framework
© RapidValue Solutions Confidential 6
README.md Introductory documentation for the root app.
angular.json CLI configuration defaults for all projects in the workspace, including configuration options
for build, serve, and test tools that the CLI uses, such as TSLint, Karma, and Protractor.
package.json Configures npm package dependencies that are available to all projects in the workspace.
package-lock.json Provides version information for all packages installed into node_modules by the npm
client.
src/ Source files for the root-level application project.
node_modules/ Npm packages to the entire workspace. Workspace-wide node_modules dependencies are
visible to all projects.
tsconfig.json Default TypeScript configuration for projects in the workspace.
tslint.json Default TSLint configuration for projects in the workspace.
Step 2
Create new project UserManagement.
Type in:-
ng generate application UserManagement
Similarly create an application called Login following the same above commands.
ng generate application Login
The end result will be like:-
How to Implement Micro Frontend Architecture using Angular Framework
© RapidValue Solutions Confidential 7
Note - The Login and User Management are two separate Angular Applications. We also have an option to set the
default when the workspace is served. All the features that can be used in Angular projects apply to each of these
projects too. Additional to that, we can also share the styles, assets and services across all the projects inside the
workspace.
APP SUPPORT
FILES PURPOSE
app/ Component files in which your application logic and data are defined.
assets/ Images and other asset files to be copied when you build your application.
environments/ Build configuration options for particular target environments. By default there is an unnamed
standard development environment and a production ("prod") environment. You can define
additional target environment configurations.
favicon.ico Icon used in the bookmark bar.
index.html The main HTML page that is served when someone visits your site. The CLI automatically adds
all JavaScript and CSS files when building your app, so you typically don't need to add any
<script> or<link> tags here manually.
main.ts The main entry point for your application. Compiles the application with the JIT compiler and
bootstraps the application's root module (AppModule) to run in the browser.
polyfills.ts Provides polyfill scripts for browser support.
styles.sass Lists CSS files that supply styles for a project. The extension reflects the style preprocessor you
have configured for the project.
test.ts Main entry point for your unit tests, with some Angular-specific configuration. You don't typically
need to edit this file.
app/src/
Angular components, templates, and styles go here. The app/scr/ folder inside contain your
project's logic and data.
Step 3 –
How to Implement Micro Frontend Architecture using Angular Framework
© RapidValue Solutions Confidential 8
Create a library apiCall in the work space.
Type in:-
ng generate library apiCall
It will look like the following in the editor:-
Now the newly created apiCall library can be added as a dependency in both the Login and User Management
applications created earlier. The library can be reused across the workspace.
How to Implement Micro Frontend Architecture using Angular Framework
© RapidValue Solutions Confidential 9
About RapidValue
RapidValue is a global leader in providing digital product engineering solutions including Mobility, Cloud,
Omni-channel, IoT and RPA to enterprises worldwide. RapidValue offers its digital services to the world’s
top brands, Fortune 1000 companies, and innovative emerging start-ups. With offices in the United
States, the United Kingdom, Germany, and India and operations spread across the Middle-East, Europe,
and Canada, RapidValue delivers enterprise service and solutions across various industry verticals.
Disclaimer:
This document contains information that is confidential and proprietary to RapidValue Solutions Inc. No part of it may be used,
circulated, quoted, or reproduced for distribution outside RapidValue. If you are not the intended recipient of this report, you are
hereby notified that the use, circulation, quoting, or reproducing of this report is strictly prohibited and may be unlawful.
© RapidValue Solutions
www.rapidvaluesolutions.com/blogwww.rapidvaluesolutions.com
+1 877.643.1850 contactus@rapidvaluesolutions.com

More Related Content

What's hot (20)

PDF
Google Firebase presentation - English
Alexandros Tsichouridis
 
PPTX
Introduction to Progressive Web App
Binh Bui
 
PDF
[LetSwift 2023] 객체지향-함수형 아키텍처 직접 만들기
Moonbeom KWON
 
PDF
API Security Best Practices and Guidelines
WSO2
 
PPTX
Backstage at CNCF Madison.pptx
BrandenTimm1
 
PDF
Intro to vue.js
TechMagic
 
PPTX
Spring Boot
Jiayun Zhou
 
PDF
The magic of flutter
Shady Selim
 
PPTX
Introduction to spring boot
Santosh Kumar Kar
 
PPTX
Micro-Frontend Architecture
Livares Technologies Pvt Ltd
 
PPTX
Introduction to angular with a simple but complete project
Jadson Santos
 
PDF
Selenium Maven With Eclipse | Edureka
Edureka!
 
PPTX
DevOps Presentation.pptx
Abdullah al Mamun
 
PPTX
Angular Best Practices To Build Clean and Performant Web Applications
Albiorix Technology
 
PDF
Flutter for web
rihannakedy
 
PPTX
Cypress Automation
Susantha Pathirana
 
PDF
Flutter Tutorial For Beginners | Edureka
Edureka!
 
PDF
Api Gateway
KhaqanAshraf
 
PDF
Spring Boot
HongSeong Jeon
 
PDF
I Love APIs 2015 : Zero to Thousands TPS Private Cloud Operations Workshop
Apigee | Google Cloud
 
Google Firebase presentation - English
Alexandros Tsichouridis
 
Introduction to Progressive Web App
Binh Bui
 
[LetSwift 2023] 객체지향-함수형 아키텍처 직접 만들기
Moonbeom KWON
 
API Security Best Practices and Guidelines
WSO2
 
Backstage at CNCF Madison.pptx
BrandenTimm1
 
Intro to vue.js
TechMagic
 
Spring Boot
Jiayun Zhou
 
The magic of flutter
Shady Selim
 
Introduction to spring boot
Santosh Kumar Kar
 
Micro-Frontend Architecture
Livares Technologies Pvt Ltd
 
Introduction to angular with a simple but complete project
Jadson Santos
 
Selenium Maven With Eclipse | Edureka
Edureka!
 
DevOps Presentation.pptx
Abdullah al Mamun
 
Angular Best Practices To Build Clean and Performant Web Applications
Albiorix Technology
 
Flutter for web
rihannakedy
 
Cypress Automation
Susantha Pathirana
 
Flutter Tutorial For Beginners | Edureka
Edureka!
 
Api Gateway
KhaqanAshraf
 
Spring Boot
HongSeong Jeon
 
I Love APIs 2015 : Zero to Thousands TPS Private Cloud Operations Workshop
Apigee | Google Cloud
 

Similar to How to Implement Micro Frontend Architecture using Angular Framework (20)

PPTX
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
Chris O'Brien
 
ODP
Pyramid patterns
Carlos de la Guardia
 
PPTX
An Overview of Angular 4
Cynoteck Technology Solutions Private Limited
 
PPTX
Alfresco Development Framework Basic
Mario Romano
 
PDF
Priming Your Teams For Microservice Deployment to the Cloud
Matt Callanan
 
PDF
بررسی چارچوب جنگو
railsbootcamp
 
PDF
How to Webpack your Django!
David Gibbons
 
PDF
Angular 7 Firebase5 CRUD Operations with Reactive Forms
Digamber Singh
 
PPTX
Angular4 getting started
TejinderMakkar
 
PPTX
Angularjs2 presentation
dharisk
 
PDF
3 Ways to Get Started with a React App in 2024.pdf
BOSC Tech Labs
 
PPTX
Azure machine learning service
Ruth Yakubu
 
PDF
Appcelerator Titanium Alloy + Kinvey Collection Databinding - Part One
Aaron Saunders
 
PPTX
React django
Heber Silva
 
PPTX
SharePoint Saturday Atlanta 2015
Pushkar Chivate
 
PPTX
A Presentation of Dash Enterprise and Its Interface.pptx
MusaBadaru
 
PDF
PVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agents
Andrey Karpov
 
PPTX
Useful practices of creation automatic tests by using cucumber jvm
Anton Shapin
 
PPTX
Web worker in your angular application
Suresh Patidar
 
PDF
Angular performance slides
David Barreto
 
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
Chris O'Brien
 
Pyramid patterns
Carlos de la Guardia
 
Alfresco Development Framework Basic
Mario Romano
 
Priming Your Teams For Microservice Deployment to the Cloud
Matt Callanan
 
بررسی چارچوب جنگو
railsbootcamp
 
How to Webpack your Django!
David Gibbons
 
Angular 7 Firebase5 CRUD Operations with Reactive Forms
Digamber Singh
 
Angular4 getting started
TejinderMakkar
 
Angularjs2 presentation
dharisk
 
3 Ways to Get Started with a React App in 2024.pdf
BOSC Tech Labs
 
Azure machine learning service
Ruth Yakubu
 
Appcelerator Titanium Alloy + Kinvey Collection Databinding - Part One
Aaron Saunders
 
React django
Heber Silva
 
SharePoint Saturday Atlanta 2015
Pushkar Chivate
 
A Presentation of Dash Enterprise and Its Interface.pptx
MusaBadaru
 
PVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agents
Andrey Karpov
 
Useful practices of creation automatic tests by using cucumber jvm
Anton Shapin
 
Web worker in your angular application
Suresh Patidar
 
Angular performance slides
David Barreto
 
Ad

More from RapidValue (20)

PDF
How to Build a Micro-Application using Single-Spa
RapidValue
 
PDF
Play with Jenkins Pipeline
RapidValue
 
PDF
Accessibility Testing using Axe
RapidValue
 
PDF
Guide to Generate Extent Report in Kotlin
RapidValue
 
PDF
Automation in Digital Cloud Labs
RapidValue
 
PDF
Microservices Architecture - Top Trends & Key Business Benefits
RapidValue
 
PDF
Uploading Data Using Oracle Web ADI
RapidValue
 
PDF
Appium Automation with Kotlin
RapidValue
 
PDF
Build UI of the Future with React 360
RapidValue
 
PDF
Python Google Cloud Function with CORS
RapidValue
 
PDF
Real-time Automation Result in Slack Channel
RapidValue
 
PDF
Automation Testing with KATALON Cucumber BDD
RapidValue
 
PDF
Video Recording of Selenium Automation Flows
RapidValue
 
PDF
JMeter JMX Script Creation via BlazeMeter
RapidValue
 
PDF
Migration to Extent Report 4
RapidValue
 
PDF
The Definitive Guide to Implementing Shift Left Testing in QA
RapidValue
 
PDF
Data Seeding via Parameterized API Requests
RapidValue
 
PDF
Test Case Creation in Katalon Studio
RapidValue
 
PDF
How to Perform Memory Leak Test Using Valgrind
RapidValue
 
PDF
DevOps Continuous Integration & Delivery - A Whitepaper by RapidValue
RapidValue
 
How to Build a Micro-Application using Single-Spa
RapidValue
 
Play with Jenkins Pipeline
RapidValue
 
Accessibility Testing using Axe
RapidValue
 
Guide to Generate Extent Report in Kotlin
RapidValue
 
Automation in Digital Cloud Labs
RapidValue
 
Microservices Architecture - Top Trends & Key Business Benefits
RapidValue
 
Uploading Data Using Oracle Web ADI
RapidValue
 
Appium Automation with Kotlin
RapidValue
 
Build UI of the Future with React 360
RapidValue
 
Python Google Cloud Function with CORS
RapidValue
 
Real-time Automation Result in Slack Channel
RapidValue
 
Automation Testing with KATALON Cucumber BDD
RapidValue
 
Video Recording of Selenium Automation Flows
RapidValue
 
JMeter JMX Script Creation via BlazeMeter
RapidValue
 
Migration to Extent Report 4
RapidValue
 
The Definitive Guide to Implementing Shift Left Testing in QA
RapidValue
 
Data Seeding via Parameterized API Requests
RapidValue
 
Test Case Creation in Katalon Studio
RapidValue
 
How to Perform Memory Leak Test Using Valgrind
RapidValue
 
DevOps Continuous Integration & Delivery - A Whitepaper by RapidValue
RapidValue
 
Ad

Recently uploaded (20)

PPTX
Customise Your Correlation Table in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PPTX
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PPTX
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
PDF
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
PDF
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
PPTX
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
PDF
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
PDF
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
PDF
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
PDF
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
PDF
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PDF
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
PPTX
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
Customise Your Correlation Table in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 

How to Implement Micro Frontend Architecture using Angular Framework

  • 1. How to Implement Micro Frontend Architecture using Angular Framework Presented by: Unnikrishnan M, Software Engineer
  • 2. How to Implement Micro Frontend Architecture using Angular Framework © RapidValue Solutions Confidential 2 Micro Frontend Architecture in Angular The Angular team introduced the concept of workspaces in their 7.0.0 version which was released in Oct, 2018. With this update, Angular gave developers a new --create-application flag feature during creation of the application. By default the --create-application flag will be false. Example:- ng new <workspaceName> --create-application=<true/false> With this addition, the developers now have the option to easily create an application, library or workspace. The following is the Angular CLI command to generate/modify the files based on schematics:- ng generate <schematic> [options] This schematic can take one of the following values: • appShell • application • class • component • directive • enum • guard • interceptor • interface • library • module • pipe • service • serviceWorker • webWorker Workspace Setup-Basic Angular CLI Commands How to Implement Micro Frontend Architecture using Angular Framework We will be looking into the basic commands used for generating:- 1. Application ng generate application <name> [options] ng g application <name> [options] OPTION DESCRIPTION --inlineStyle=true|false True -> Includes styles inline in the root component.ts file. Only CSS styles can be included inline. False -> External styles file is created and referenced in the root component.ts file. Default: false Aliases: -s
  • 3. How to Implement Micro Frontend Architecture using Angular Framework © RapidValue Solutions Confidential 3 --inlineTemplate=true|false True -> Includes template inline in the root component.ts file. False ->External template file is created and referenced in the root component.ts file. Default: false Aliases: -t --lintFix=true|false True -> Applies lint fixes after generating the application. Default: false --minimal=true|false True -> Creates a bare-bones project without any testing frameworks. (Used for learning purposes only.) Default: false --prefix=prefix A prefix to apply to generated selectors. Default: app Aliases: -p --routing=true|false True -> Creates a routing NgModule. Default: false --skipInstall=true|false Skips installing dependency packages. Default: false --skipPackageJson=true|false True -> Does not add dependencies to the "package.json" file. Default: false --skipTests=true|false True -> Does not create "spec.ts" test files for the app. Default: false Aliases: -S --style= css|scss|sass|less|styl File extension/preprocessor to use for style files. Default: css --viewEncapsulation= Emulated|Native|None|ShadowDom View encapsulation strategy to use in the new app. 2. Component ng generate component <name> [options] ng g component <name> [options] OPTION DESCRIPTION --changeDetection=Default|OnPush Change detection strategy to use in the new component. Default: Default Aliases: -c --displayBlock=true|false Specifies if the style will contain :host { display: block; }. Default: false Aliases: -b --export=true|false True -> Declaring NgModule exports this component. Default: false --flat=true|false True -> Creates the new files at the top level of the current project. Default: false
  • 4. How to Implement Micro Frontend Architecture using Angular Framework © RapidValue Solutions Confidential 4 --inlineStyle=true|false True -> Includes styles inline in the root component.ts file. Only CSS styles can be included inline. False -> External styles file is created and referenced in the root component.ts file. Default: false Aliases: -s --inlineTemplate=true|false True -> Includes template inline in the root component.ts file. False ->External template file is created and referenced in the root component.ts file. Default: false Aliases: -t --lintFix=true|false True -> Applies lint fixes after generating the application. Default: false --module=module Declaring NgModule. Aliases: -m --prefix=prefix Prefix to apply to the generated component selector. Aliases: -p --project=project Name of the project. --selector=selector HTML selector to use for this component. --skipImport=true|false True -> Does not import this component into the owning NgModule. Default: false --skipSelector=true|false True -> Specifies if the component should have a selector. Default: false --skipTests=true|false True -> Does not create "spec.ts" test files for the new component. Default: false --style= css|scss|sass|less|styl File extension or preprocessor to use for style files. Default: css --type=type Adds a developer-defined type to the filename, in the format "name.type.ts". Default: Component --viewEncapsulation= Emulated|Native|None|ShadowDom View encapsulation strategy to use in the new component. Aliases: -v 3. Library ng generate library <name> [options] ng g library <name> [options] OPTION DESCRIPTION --entryFile=entryFile Path in which the library's public API file is created, relative to the workspace root. Default: public-api --lintFix=true|false True -> Applies lint fixes after generating the library. Default: false
  • 5. How to Implement Micro Frontend Architecture using Angular Framework © RapidValue Solutions Confidential 5 --prefix=prefix Prefix to apply to generated selectors. Default: lib Aliases: -p --skipInstall=true|false True -> does not install dependency packages. Default: false -- skipPackageJson=true|false True -> Does not add dependencies to the "package.json" file. Default: false --skipTsConfig=true|false True -> Does not update "tsconfig.json" to add a path mapping for the new library. The path mapping is needed to use the library in an app, but can be disabled here to simplify development. Default: false How to Implement Micro Frontend Architecture using Angular Framework The basic idea is to create an application that has the following characteristics, incorporating the new feature. The outline is as follows:- 1. Create a workspace named Next. 2. It has 2 projects named - User Management, Login. 3. It has a library named apiCall which is used across the 2 projects. Let's start creating it:- Step 1 Open git bash in the desired folder location. Type in:- ng new Next --create-application=false; Dive inside the Next folder. The created project structure is as follows:- WORKSPACE CONFIG FILES PURPOSE .editorconfig Configuration for code editors. .gitignore Specifies intentionally untracked files that Git should ignore.
  • 6. How to Implement Micro Frontend Architecture using Angular Framework © RapidValue Solutions Confidential 6 README.md Introductory documentation for the root app. angular.json CLI configuration defaults for all projects in the workspace, including configuration options for build, serve, and test tools that the CLI uses, such as TSLint, Karma, and Protractor. package.json Configures npm package dependencies that are available to all projects in the workspace. package-lock.json Provides version information for all packages installed into node_modules by the npm client. src/ Source files for the root-level application project. node_modules/ Npm packages to the entire workspace. Workspace-wide node_modules dependencies are visible to all projects. tsconfig.json Default TypeScript configuration for projects in the workspace. tslint.json Default TSLint configuration for projects in the workspace. Step 2 Create new project UserManagement. Type in:- ng generate application UserManagement Similarly create an application called Login following the same above commands. ng generate application Login The end result will be like:-
  • 7. How to Implement Micro Frontend Architecture using Angular Framework © RapidValue Solutions Confidential 7 Note - The Login and User Management are two separate Angular Applications. We also have an option to set the default when the workspace is served. All the features that can be used in Angular projects apply to each of these projects too. Additional to that, we can also share the styles, assets and services across all the projects inside the workspace. APP SUPPORT FILES PURPOSE app/ Component files in which your application logic and data are defined. assets/ Images and other asset files to be copied when you build your application. environments/ Build configuration options for particular target environments. By default there is an unnamed standard development environment and a production ("prod") environment. You can define additional target environment configurations. favicon.ico Icon used in the bookmark bar. index.html The main HTML page that is served when someone visits your site. The CLI automatically adds all JavaScript and CSS files when building your app, so you typically don't need to add any <script> or<link> tags here manually. main.ts The main entry point for your application. Compiles the application with the JIT compiler and bootstraps the application's root module (AppModule) to run in the browser. polyfills.ts Provides polyfill scripts for browser support. styles.sass Lists CSS files that supply styles for a project. The extension reflects the style preprocessor you have configured for the project. test.ts Main entry point for your unit tests, with some Angular-specific configuration. You don't typically need to edit this file. app/src/ Angular components, templates, and styles go here. The app/scr/ folder inside contain your project's logic and data. Step 3 –
  • 8. How to Implement Micro Frontend Architecture using Angular Framework © RapidValue Solutions Confidential 8 Create a library apiCall in the work space. Type in:- ng generate library apiCall It will look like the following in the editor:- Now the newly created apiCall library can be added as a dependency in both the Login and User Management applications created earlier. The library can be reused across the workspace.
  • 9. How to Implement Micro Frontend Architecture using Angular Framework © RapidValue Solutions Confidential 9 About RapidValue RapidValue is a global leader in providing digital product engineering solutions including Mobility, Cloud, Omni-channel, IoT and RPA to enterprises worldwide. RapidValue offers its digital services to the world’s top brands, Fortune 1000 companies, and innovative emerging start-ups. With offices in the United States, the United Kingdom, Germany, and India and operations spread across the Middle-East, Europe, and Canada, RapidValue delivers enterprise service and solutions across various industry verticals. Disclaimer: This document contains information that is confidential and proprietary to RapidValue Solutions Inc. No part of it may be used, circulated, quoted, or reproduced for distribution outside RapidValue. If you are not the intended recipient of this report, you are hereby notified that the use, circulation, quoting, or reproducing of this report is strictly prohibited and may be unlawful. © RapidValue Solutions www.rapidvaluesolutions.com/blogwww.rapidvaluesolutions.com +1 877.643.1850 [email protected]