Useful Angular Libraries

For cloning use clone library that you can wrap in a service with a generic method that acts like a facade

For immutability use immutable

For unsubscribing from Observables:

  • Unsubscribe using ngOnDestroy

Angular Application Architecture

When building an Angular application there are a sent of considerations one should take into account:

  1. Application Overview
    • the purpose & goals of the application
    • how is the client going to use it
    • the business and strategic benefits it brings
  2. Application Features
    • one should be able to list key application feature (depending on the development model – agile or waterfall)
  3. Domain Security
    • are we using roles/groups/claims on server side
    • how are they going to be communicated to the Angular application
    • communication between Angular and API (eg. token based, HTTPS)
  4. Domain Rules
    • relation between domains
    • validation on domain done both on Angular and Backend
  5. Logging
    • create a logging API or integrate with a cloud option
  6. Service Communication
    • HTTP/HTTPS
    • for real-time communication use WebSockets
  7. Data Models
    • how does the data from the API to the Angular look like
    • do we need to modify the data from the API
  8. Feature Components
    • how will the components be structured (eg. presentational container pattern)
    • how will the components interact and exchange data
  9. Shared Functionality
    • do we use 3rd party components
    • do we re-share functionality inside the same Angular application or between multiple Angular applications

Before starting to develop the Angular application is important to have a planning meeting and note initial information related to the topics above. It is important for everyone in the meeting to have access to write their ideas.

One important aspect is to use a style guide that is based on the official Angular style guide.

Related to the shared libraries there are a set of libraries that can save you time when developing the application:

  • Kendo UI for Angular
  • PrimeNG
  • NgBootstrap
  • Angular Material

Other considerations that might affect the architecture of the Angular application:

  • Accessibility
  • i18n
  • Environments (test/stage/prod)
  • CI/CD
  • Deployed (CDN/container/server)
  • Testing (unit testing, end-to-end)
  • APIs in the backend