Tomas Marik
Tomas Marik

Reputation: 4093

Angular 2: Can't resolve service from my library

I have 2 angular projects:

I want to use MyLib in MyApp project. MyLib contains library created by angular cli. I built it, installed it and imported MyLibModule into MyAppModule - everything seems ok. Problem is when I use any service from the MyLib in any MyApp component I am getting: Module not found: Error: Can't resolve..

Each service in lib module has:

@Injectable({providedIn: 'root'})
export class MyLibService {

Each component & pipe in MyLib is listed in the export section of the MyLibModule.

Thanx for any advice.

Upvotes: 1

Views: 737

Answers (1)

Tomas Marik
Tomas Marik

Reputation: 4093

Problem was not having all classes listed in the public_api.ts.

Upvotes: 1

Related Questions