My goal is to create a simple structure:
app
--_layout
--public-footer
----public-footer.html/ts/css files
--public-header
----public-header.html/ts/css files
--public-layout
----public-layout.html/ts/css files
In public-layout.html, the structure should be:
<public-header></public-header>
<router-outlet></router-outlet>
<public-footer></public-footer>
In public-layout.ts:
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-public-layout',
templateUrl: './public-layout.component.html',
styleUrls: ['./public-layout.component.css']
})
export class PublicLayoutComponent implements OnInit {
constructor() { }
ngOnInit() {}
}
I want this public-layout to be used with other components such as Home, About, etc.
I've been struggling to make it work for the About component. I've tried various combinations but none have worked for me.
My expectation is that I shouldn't have to declare/import the header and footer in app.module.
Can anyone offer assistance?