• About Morris Development
  • A Focus for Cloud Efficiency
    • Microsoft Azure
    • Amazon Web Services
  • What our Clients Say
  • Our Products
    • PreschoolDB
    • WebinarDB
  • Contact Us

Morris Development

Custom System Development and Integration

April 10, 2020

Angular Modules and Sub-Modules

One problem that I’ve run into consistently has been various components not appearing on the webpage. So, if I had

<mat-progress-bar class="" color="primary" mode="determinate" [value]="item.progress"> </mat-progress-bar>

Sometimes it just won’t appear. Here’s the structure we need to remember:

app.module.ts has all the primary things you need for running the site, but NOT the UI components.

So then, you’ve got sub-modules. Like, perhaps you’ve got a user manager section: app-user.module.ts

The way we get to those is with lazy loading. IT works like this: In app.routes, you create a subdirectory, where you load the “feature module” as kind of a querystring option

 {
        path: 'ops', 
        loadChildren: './views/operations/operations.module#OperationsModule', 
        data: { title: 'Operations', breadcrumb: 'Operations'}
      },

So, we’ve got the primary module loaded. And, it really should have as little as possible in it. ( Seriously, even the login should go to a login-feature module.) Now, the feature module is where we want to put all our UI code. Because this is lazy-loaded, we aren’t sharing any UI components. So, if you are using Material Design modules, they need to come in here – in every feature module.

There is an exception: Services. While the app.module doesn’t share any declarations or modules to feature modules, the Services are shared.


Here is a short and simple post that can also help: https://medium.com/@cyrilletuzi/understanding-angular-modules-ngmodule-and-their-scopes-81e4ed6f7407

Article by MacGyver / Angular 2

About MacGyver

I've worked with database systems for over 20 years, and started my own company in 2000. Almost all my business consists of internal database systems, either ERP or CRM. My programming is primarily in Angular / Microsoft C# and MS SQL.

About This Site

Morris Development has been specializing in internal database system design and integration since 1999. We provide long-term management and support of secure data systems for many businesses as well as developing the more complex code structures for ERP systems like Intellievent, Apidas, and AVMS.

This site is primarily for our developers to keep track up various technologies and updates that are used by Morris Development.

Training

Integrating Angular Microsite with .Net

Private Data Caching with Google Storage

Continuous Deployment for Production Releases?

Azure Websites – the perfect Angular host

Angular 2

  • Angular 2 Authentication
  • Angular Command Line Interface
  • Material Design for Angular
  • Using Observables in Angular 2

Mentors

  • Ben Nadel
  • Dan Wahlin
  • Deborah Kurata
  • John Papa

Staff

  • Dan Morris

Training

  • Google Development Courses
  • Microsoft Virtual Academy
  • PluralSight
  • Test Deep Links

© 2025 · Morris Development