Keilla Fernandes
Front-end Developer at Daitan Group
Bacharel em Ciência da Computação
Codando desde 2008
Desenvolvedora Front-end
Aplicações Angular (fev/2017)
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
Tipo | Exports | Exemplo |
---|---|---|
Domain | Componentes Topos | - |
Routed | não | Lazy Loadeds |
Routing | RouterModule | Rotas |
Service | não | CoreModule |
Widget | sim | 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
Webpack Plugin
import { platformBrowser } from '@angular/platform-browser';
import { AppModuleNgFactory } from '../aot/src/app/app.module.ngfactory';
console.log('Running AOT compiled');
platformBrowser().bootstrapModuleFactory(AppModuleNgFactory);
Tree Shaking
Rollup
Abordagem | FMP | % |
---|---|---|
JIT | 8.37s | 100% |
AOT | 5.15s | 62% |
AOT + Lazy Loading | 4.308s | 52% (JIT) 84% (AOT) |
slides.com/keilla/angular-performance
"I like to learn.That's an art and a science."
Katherine Johnson
@keillamenezes_
keilla@gmail.com
By Keilla Fernandes