When I run the sample provided by go-js, I don’t get this error and it works just fine. But I can’t understand why. It should break like in my application because the error seems legit.
Or do I need to set some typescript config so taht it ignores the error ?
So you declared your diagramNodeData to be a specific type. I guess you just need to cast what is generally declared as ObjectData[] to what you have declared.
I have not. I have followed the sample and it is declared like this :
public state = {
// new diagram should have a default Start node
diagramNodeData: [
{
key: 'StartNode', color1: 'white', color2: 'green', figure: 'Ellipse', label: 'Start', location: '-460 -170',
desiredSize: '120 60',
stepDefinitionCode: ''
}
],
casting it to this type would make no sense as it is such a weird type with many properties. I have casted it to ‘any’ just to avoid the compilation error.
The question is, why don’t we have this error in the gojs-angular-basic sample ? Is there something I should configure ? I don’t want to start casting as ‘any’, especially since with the new immutable approach, I’ll have to do it in many places.
it does. But I have pasted the code above and as you can see, I did not set it to that type.
It is the EXACT same code as the gojs-angular-basic sample. So there must be something configured in the sample so that it does not produce compilation error and I’d like to know what.
Some more advanced angular sample would also be appreciated because it is very basic one. Migrating to version 2.0 is driving me crazy, I have so many issues and right now my application is not working at all. I’ll open more tickets for other related issues