I have a typescript file with the following content:
import { Component, OnInit } from '@angular/core';
import { BookService } from "../../services/book.service";
import { Book } from "../../Models/book";
@Component({
selector: 'app-book-list',
templateUrl: './book-list.component.html',
styleUrls: ['./book-list.component.css']
})
export class BookListComponent implements OnInit {
books: Book[];
constructor(private bookService: BookService) {
}
ngOnInit() {
this.bookService.getBooks()
.subscribe(books => this.books = books);
}
}
When I compile, it is complaining that it doesn't know where the Book.cs file is.
Here's the error:
(TS) Cannot find Module '../../Models/Book'
However, when I was constructing this path, I constructed it through the visual studio intellisence. So, it damn well knows where it is.
Here's my project structure:
Can someone tell me what am I doing wrong here?

Bookwith a different extension in the same folder?Book.cs?