I'm using a Kendo Grid in an Angular template and trying to allow a
service in the component to define some css styling but having a
problem.
<kendo-grid
*ngIf="canLoad()"
[data]=etc...
[rowClass] = "rowCallback"
>
public canLoad() : boolean
{
return this.myservice !== undefined;
}
public rowCallback(context: RowClassArgs)
{
this.myservice.doSomething();
}
I get an error "Cannot read properties of undefined (reading 'doSomething')"
... why do I get an error when the ngIf check has evaluated myservice
as being instantiated? How can I get the rowCallback to wait until the
service has been instantiated?
... also
I read a previous Telerik forum response where an employee stated
"The rowClass callback function is directly passed as a value to the ngClass directive,
which is then applied on each row." ... so just to see if my problem was a behaviour of Angular itself I
added <div [ngClass]="rowCallback()">testing...</div> and myService was available and the doSomething()
method was called.