This is my file structure:
My app.module.ts:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { SearchFormComponent } from './components/search-form/search-form.component';
import { QueryDisplayComponent } from './components/query-display/query-display.component';
import { HttpClientModule } from '@angular/common/http';
@NgModule({
declarations: [
AppComponent,
SearchFormComponent,
QueryDisplayComponent
],
imports: [
BrowserModule,
AppRoutingModule,
FormsModule,
HttpClientModule
],
exports:[],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
'' app.component.html
<div style="text-align:center">
<h1>
Places Search
</h1>
</div>
<router-outlet></router-outlet>
the component im trying to display when the route is hit
import { Component, OnInit } from '@angular/core';
// import { Place } from '../../place'
import { GetReqPlaces } from '../../services/get-req-places.service'
import { Router } from '@angular/router'
@Component({
selector: 'app-search-form',
templateUrl: './search-form.component.html',
styleUrls: ['./search-form.component.css']
})
export class SearchFormComponent implements OnInit {
constructor(private getPlaces: GetReqPlaces, private router: Router) { }
westLong: number;
eastLong: number;
northLat: number;
southLat: number;
// log(x){console.log(x)}
onSubmit(form){
this.westLong = form.value.wLong; //
this.eastLong = form.value.eLong; //
this.northLat = form.value.nLat; //
this.southLat = form.value.sLat; //
console.log(this.getPlaces.getPlaces(this.westLong,this.southLat,this.eastLong,this.northLat))
}
}
'' routing module
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { AppComponent} from './app.component'
import { SearchFormComponent} from '../components/search-form.component'
const routes: Routes = [
{ path: 'search', component: SearchFormComponent },
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
the error code is as follows in VScode:
"message": "Cannot find module '../components/search-form.component'."
and
"ERROR in src/app/app-routing.module.ts(4,36): error TS2307: Cannot find module '../components/search-form.component'."
in the angular cli when i try to serve the app.
Im kind of at my wits end, im able to import AppComponent, but why is router module not recognizing the SearchFormComponent? 4 hours into this i feel like its at the tip of my fingers but I feel like i dug myself into a black hole. Thank you for your help and patience, new to Angular and loving it... despite what this post may represent haha. I'd love to get over this bump and start working on the backend.

import { SearchFormComponent } from './components/search-form/search-form.component';