If a have a component providing it's own service:
@Component({
selector: 'user-list',
templateUrl: './user-list.component.html',
styleUrls: ['./user-list.component.scss'],
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
animations: fuseAnimations,
providers: [
TableSettingsService
]
})
export class UserListComponent {}
Can this TableSettingsService somehow get a reference of this component? I've tried
@Injectable()
export class TableSettingsService {
constructor(
persistentService: PersistentService,
@Optional() @Self() persistentObject: UserListComponent
) {
alert(!!persistentObject);
}
}
What causes a circular dependency.