sprotty icon indicating copy to clipboard operation
sprotty copied to clipboard

Angular examples

Open szymoc opened this issue 5 years ago • 2 comments

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?

szymoc avatar Jan 10 '20 13:01 szymoc

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.

spoenemann avatar Jan 13 '20 08:01 spoenemann

I would like to revive this request. An angular example in the documentation would be very helpful since ng does not use JSX

mscale-wmp avatar Aug 25 '22 20:08 mscale-wmp

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.

jonah-iden avatar Nov 03 '23 10:11 jonah-iden