I\'m using Angular Material 2 and I want to open a dialog window with MdDialog which shows some information about a user stored in firebase.
@Injectable()
ex
You faced with a circular dependency. (TweetDialogComponent --> TweetService --> TweetDialogComponent)
You can work around by using an abstract class:
base-tweet.service.ts
import { ViewContainerRef } from '@angular/core';
export abstract class BaseTweetService {
getUser() {};
sendTweet(viewContainerRef: ViewContainerRef) {}
}
app.module.ts
{ provide: BaseTweetService, useClass: TweetService },
app.component.ts
constructor(
...
private tweetService: BaseTweetService,
tweet-dialog.component.ts
constructor(
...
private tweetService: BaseTweetService) {
tweet.service.ts
export class TweetService implements BaseTweetService {
See also