Marketing Portal
Lazy Loaded Modules
Packages Removal
import { platformBrowser } from '@angular/platform-browser';
import { AppModuleNgFactory } from '../aot/src/app/app.module.ngfactory';
console.log('Running AOT compiled');
platformBrowser().bootstrapModuleFactory(AppModuleNgFactory);
Dynamic Components
Dynamic Templates
Approach | FMP | % |
---|---|---|
JIT | 8.37s | 100% |
AOT | 5.15s | 62% |
Before | After | % |
---|---|---|
3.79 MB | 2.78 MB | 26% |
Declarations
Bootstrap
Providers
Imports
Exports
@NgModule
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
@NgModule({
imports: [ BrowserModule ],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
CommonModule
Declarations
Exports
Providers
Type | Exports | Example |
---|---|---|
Domain | Top Components | - |
Routed | no | Lazy Loadeds |
Routing | RouterModule | Routes Config. |
Service | no | CoreModule |
Widget | yes | Shared |
KittyPageComponent
/kitty
/kitty/register
<h1>Kitty Page</h1>
<router-outlet name="content"></router-outlet>
{
path: 'kitty',
loadChildren: './kitty/kitty.module#KittyModule'
},
{
path: '',
component: KittyPageComponent,
children:
[
{
path: 'register',
children: [
{ path: '', component: RegisterKittyComponent, outlet: 'subpage'},
]
},
{ path: '', component: KittyComponent, outlet: 'subpage' }
]
}
AppRoutingModule
KittyModule
Approach | FMP | % |
---|---|---|
JIT | 8.37s | 100% |
AOT | 5.15s | 62% |
AOT + Lazy Loading | 4.308s | 52% (JIT) 84% (AOT) |