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 489 times
Edit
1
Community EvaluationsNo one has reviewed this question yet, be the first!
1
AngularJS: How to fix the error 'Cannot assign to 'bar' because it is a constant or a read-only property.'0
Generate a component.,The generated element will be imported/declared in the ui-tools module.,The test (*my-widget.component.spec.ts*) and template (*my-widget.component.html*) files will be created on the fly.1
Write a unit test for the DataService in AngularJS1
What are directives in AngularJS?1
What are the lifecycle hooks in AngularJS?1
What is AOT in AngularJS ?,AOT is better than JIT for production ;0
Create a new AngularJS project