chore(internal API): introduce an internal API for ngtools. (#13415)
This commit is contained in:
@ -0,0 +1,3 @@
|
||||
:host {
|
||||
background-color: blue;
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
<div>
|
||||
<h1>hello world</h1>
|
||||
<a [routerLink]="['lazy']">lazy</a>
|
||||
<router-outlet></router-outlet>
|
||||
</div>
|
@ -0,0 +1,10 @@
|
||||
import {Component, ViewEncapsulation} from '@angular/core';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
templateUrl: 'app.component.html',
|
||||
styleUrls: ['app.component.css'],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class AppComponent { }
|
@ -0,0 +1,28 @@
|
||||
import { NgModule, Component } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { AppComponent } from './app.component';
|
||||
|
||||
@Component({
|
||||
selector: 'home-view',
|
||||
template: 'home!'
|
||||
})
|
||||
export class HomeView {}
|
||||
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent,
|
||||
HomeView
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
RouterModule.forRoot([
|
||||
{path: 'lazy', loadChildren: './lazy.module#LazyModule'},
|
||||
{path: 'feature2', loadChildren: 'feature2/feature2.module#Feature2Module'},
|
||||
{path: '', component: HomeView}
|
||||
])
|
||||
],
|
||||
bootstrap: [AppComponent]
|
||||
})
|
||||
export class AppModule { }
|
@ -0,0 +1,20 @@
|
||||
import {NgModule, Component} from '@angular/core';
|
||||
import {RouterModule} from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'feature-component',
|
||||
template: 'foo.html'
|
||||
})
|
||||
export class FeatureComponent {}
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
FeatureComponent
|
||||
],
|
||||
imports: [
|
||||
RouterModule.forChild([
|
||||
{ path: '', component: FeatureComponent}
|
||||
])
|
||||
]
|
||||
})
|
||||
export class FeatureModule {}
|
@ -0,0 +1,20 @@
|
||||
import {NgModule, Component} from '@angular/core';
|
||||
import {RouterModule} from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'lazy-feature-comp',
|
||||
template: 'lazy feature!'
|
||||
})
|
||||
export class LazyFeatureComponent {}
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forChild([
|
||||
{path: '', component: LazyFeatureComponent, pathMatch: 'full'},
|
||||
{path: 'feature', loadChildren: './feature.module#FeatureModule'}
|
||||
])
|
||||
],
|
||||
declarations: [LazyFeatureComponent]
|
||||
})
|
||||
export class LazyFeatureModule {
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
import {NgModule, Component} from '@angular/core';
|
||||
import {RouterModule} from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'feature-component',
|
||||
template: 'foo.html'
|
||||
})
|
||||
export class FeatureComponent {}
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
FeatureComponent
|
||||
],
|
||||
imports: [
|
||||
RouterModule.forChild([
|
||||
{ path: '', component: FeatureComponent },
|
||||
])
|
||||
]
|
||||
})
|
||||
export default class DefaultModule {}
|
@ -0,0 +1,22 @@
|
||||
import {NgModule, Component} from '@angular/core';
|
||||
import {RouterModule} from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'feature-component',
|
||||
template: 'foo.html'
|
||||
})
|
||||
export class FeatureComponent {}
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
FeatureComponent
|
||||
],
|
||||
imports: [
|
||||
RouterModule.forChild([
|
||||
{ path: '', component: FeatureComponent },
|
||||
{ path: 'd', loadChildren: './default.module' }
|
||||
{ path: 'e', loadChildren: 'feature/feature.module#FeatureModule' }
|
||||
])
|
||||
]
|
||||
})
|
||||
export class Feature2Module {}
|
@ -0,0 +1,23 @@
|
||||
import {NgModule, Component} from '@angular/core';
|
||||
import {RouterModule} from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'lazy-comp',
|
||||
template: 'lazy!'
|
||||
})
|
||||
export class LazyComponent {}
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forChild([
|
||||
{path: '', component: LazyComponent, pathMatch: 'full'},
|
||||
{path: 'feature', loadChildren: './feature/feature.module#FeatureModule'},
|
||||
{path: 'lazy-feature', loadChildren: './feature/lazy-feature.module#LazyFeatureModule'}
|
||||
])
|
||||
],
|
||||
declarations: [LazyComponent]
|
||||
})
|
||||
export class LazyModule {
|
||||
}
|
||||
|
||||
export class SecondModule {}
|
@ -0,0 +1,19 @@
|
||||
{
|
||||
"angularCompilerOptions": {
|
||||
// For TypeScript 1.8, we have to lay out generated files
|
||||
// in the same source directory with your code.
|
||||
"genDir": ".",
|
||||
"debug": true
|
||||
},
|
||||
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"experimentalDecorators": true,
|
||||
"noImplicitAny": true,
|
||||
"moduleResolution": "node",
|
||||
"rootDir": "",
|
||||
"declaration": true,
|
||||
"lib": ["es6", "dom"],
|
||||
"baseUrl": "."
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user