sprotty
sprotty copied to clipboard
Angular examples
The examples are much friendlier to the React ecosystem than Angular due to the use of JSX. Would it be possible to provide a simple example of a Sprotty diagram in Angular?
The examples do not use React, but snabbdom-jsx to generate Snabbdom virtual DOMs using JSX. It's actually not so easy to use that syntax within a React project because it's not compatible with React's JSX.
We might consider switching to snabbdom-pragma, which is the "favorite way to use JSX with Snabbdom", CC @JanKoehnlein.
I would like to revive this request. An angular example in the documentation would be very helpful since ng does not use JSX
Hi, after thinking a bit about it i don't really think we need extra documentation for this. Integrating sprotty into an Angular-application is relatively simple. Just create a, Angular-component containing a div with an id like "sprotty-container"
. In the ngAfterViewInit()
method you could then do the sprotty initialization and container creation passing in the container-id you specified previously (see Sprotty Getting Started).
If you are talking about wanting to write sprotty views as Angular components, that is just not possible and would require a full rewrite of the sprotty rendering logic. So even if you integrate Sprotty into an Angular application you will still have to write sprotty-views in JSX.