Expert
Given the following code
const routes: Routes = [{
path: 'parent',
component: AbstractParentComponent,
children: [
{
path: '',
component: ParentComponent
},
{
path: 'child',
component: ChildComponent
}
]
}];
With the following components:
// abstractparent.component.ts
import {Component} from '@angular/core';
@Component({
selector: 'app-abstract-parent',
template: 'Parent: <router-outlet></router-outlet>'
})
export class AbstractParentComponent {
constructor() {
}
}
// parent.component.ts
import {Component} from '@angular/core';
@Component({
selector: 'app-parent',
template: 'Parent'
})
export class ParentComponent {
constructor() {
}
}
// child.component.ts
import {Component} from '@angular/core';
@Component({
selector: 'app-child',
template: '<p>child</p>'
})
export class ChildComponent {
constructor() {
}
}
What will the page at the URL /parent/child
display?
Author: Mathieu RobinStatus: PublishedQuestion passed 460 times
Edit
Similar QuestionsMore questions about AngularJS
1
What are the lifecycle hooks in AngularJS?1
What are directives in AngularJS?1
Write a unit test for the DataService in AngularJS1
What is AOT in AngularJS ?,AOT is better than JIT for production ;1
AngularJS: How to fix the error 'Cannot assign to 'bar' because it is a constant or a read-only property.'