0

I am building a router component in angular and typescript.

observe my current project structure below. enter image description here

Lets focus on the landingPageComponent

observe by the image that my path to the component is valid but is not recognized.

my code in my landingpageComponent.ts file:

 import { Component, OnInit, ViewChild } from '@angular/core';
import {NgForm} from '@angular/forms';


@Component({
  selector: 'app-landing-page',
  templateUrl: './landingpage.component.html',
  styleUrls: ['./landingpage.component.css']
})
export class LandingPageComponent implements OnInit {
  @ViewChild('f')citySubmit : NgForm;

  cities:string[]=['Chicago', 'New Mexico', 'London'];

  ngOnInit() {
  }

}

the proper imports are done in the app.module.ts file without error. Meaning the path is recognized.

I am hoping I am just making a silly mistake somewhere

Thank you.

2
  • What is the import path if you go into app.module.ts? Commented Jun 17, 2017 at 15:38
  • import { LandingPageComponent } from './landingpage/landingpage.component'; Commented Jun 17, 2017 at 17:40

1 Answer 1

2

In your app.routing.module.ts it should be,

import { LandingPageComponent } from './landingpage/landingpage.component';
import { HowItWorksComponent } from './howitworks/howitworks.component'
Sign up to request clarification or add additional context in comments.

6 Comments

no significant change from what I had the problem persists
did you change as above
i did. fixed the " to ' and removed the second ; with no change.
same as before. No change. Error code is following: TS2307: cannot find module
cannot find which module?
|