Reputation: 156
i have create a new angular module
import { Component } from '@angular/core';
import { Hero } from './hero';
@Component({
selector: 'hero-detail',
template: `
<div *ngIf="hero">
<h2>{{hero.name}} details!</h2>
<div><label>id: </label>{{hero.id}}</div>
<div>
<label>name: </label>
<input [(ngModel)]="hero.name" placeholder="name"/>
</div>
</div>
`
})
export class HeroDetailComponent {
hero: Hero;
}
and i'm trying to import it in my app-root module using the import statement
import { HeroDetail } from 'hero-detail';
but i get this error "src/app/app.component.ts (2,28): Cannot find module 'hero-detail'."
Upvotes: 0
Views: 112
Reputation: 156
this resolve it for me
import { HeroDetailComponent } from './hero-detail.component';
Upvotes: 1
Reputation: 936
You must use the right name of componenet
import { HeroDetailComponent } from 'hero-detail';
Upvotes: 0