I am following a little Angular-cli tutorial, and in one of my component TS file, I import a class from another folder, but apparently it cannot be reached.
Here is my component file (display-user-data-form.component.ts):
import { Component, OnInit } from '@angular/core';
import { UserInfoModel } from '../models';
@Component({
selector: 'display-user-data-form',
templateUrl: './display-user-data-form.component.html',
styleUrls: ['./display-user-data-form.component.css']
})
export class DisplayUserDataFormComponent implements OnInit {
user: UserInfoModel = new UserInfoModel({guid: "D21ds12x",
customerUid: "cust2dsa12dsa",
first_name: "John",
last_name: "Doe",
email: "[email protected]",
zipcode: 10283,
password: "Idasn2x2#"});
constructor() { }
ngOnInit(): void {
}
}
You see I am importing a class called "UserInfoModel" from a folder named "models".
My file tree looks like this in the 'app' folder:
app
-display-user-data-form
--display-user-data-form.component.ts
--display-user-data-form.component.html
--display-user-data-form.component.css
-models
--UserInfoModel.ts
I really don't know why it can't find the module and can't figure out why the path I give is not correct.
Thanks in advance for your answers!
UserInfoModal.tsfile? And, can you also try to imports the right file ->import { UserInfoModel } from '../models/UserInfoModel';?