Issue
I'm having a problem understanding why Intellij is producing an unresolved variable warning. I was hoping someone could explain why it happens.
I have an interface:
export interface Foo {
property: string;
}
And an observable of that type in my component:
foo$: Observable<Foo>
ngOnInit() {
this.foo$ = this._fooSvc.foo$;
}
The observable is retrieved from a service. The service declares the return type:
private _fooSubject: ReplaySubject<Foo>;
get foo$(): Observable<Foo> => {
return _fooSubject.asObservable();
}
And I unwrap the observable in the template using the async pipe, where I get the warning:
[ngClass]="{my-class: (foo$ | async)?.fileName === null}"
So, I define a type and get an observable of that type in the component. I assign the component variable using a service method that declares a proper return type. Still get the warning.
What am I missing? Why do I get the "Unresolved variable fileName" warning in the template?
Solution
The issue is tracked at WEB-45419, please follow it for updates
Answered By - lena
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.