I have a pretty simple question.
I created a new angular project using the cli. I then created a module and component called home-page. Within homepage, I created a component called banner.
My main application can import the component just fine. But home page can't seem to import .
Here's my project structure :
├── app.component.html
├── app.component.sass
├── app.component.spec.ts
├── app.component.ts
├── app.module.ts
├── home-page
│ ├── banner
│ │ ├── banner.component.html
│ │ ├── banner.component.sass
│ │ ├── banner.component.spec.ts
│ │ └── banner.component.ts
│ ├── home-page.component.html
│ ├── home-page.component.sass
│ ├── home-page.component.spec.ts
│ ├── home-page.component.ts
│ └── home-page.module.ts
└── simple-grid.scss
Here's the home-page.component.ts:
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'home-page',
templateUrl: './home-page.component.html',
styleUrls: ['./home-page.component.sass']
})
export class HomePageComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
Here's the home-page.module.ts:
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { BannerComponent } from './banner/banner.component';
import { HomePageComponent } from './home-page.component';
@NgModule({
imports: [
CommonModule
],
declarations: [
BannerComponent,
HomePageComponent
]
})
export class HomePageModule { }
home-page.component.html:
<div>
<banner></banner>
</div>
banner.component.ts:
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'banner',
templateUrl: './banner.component.html',
styleUrls: ['./banner.component.sass']
})
export class BannerComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
banner.component.html:
<div id="app" class="container">
<div class="row">
<div class="col-4 center"><p>1</p></div>
<div class="col-4 center"><p>2</p></div>
<div class="col-4 center"><p>3</p></div>
</div>
</div>
I know this type of question has been asked before, but they looked like they were asking about stranger imports. I think mine should be a lot more basic, so I'd like to know which step I missed or if I have a typo or something.
Thanks