I followed the QuickStart from Angular2. And I made the folder structure different compare to the tutorial. And I encounter an error that cannot find module ....
I understand the cause of the error is import issue.
My folder structure:
I have export the hero
interface in the hero.ts file. And I want to import this interface in hero-detail.component.ts
file.
I had tried:
import {Hero} from '../app/hero';
import {Hero} from './hero';
import {Hero} from './app/hero';
None of these are working.
The system configure in the index.html
How does import work in Angular 2?
Then you'd probably need something like
import {Hero} from '../hero';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With