Skip to content
Advertisement

Can I use something similar to Angular’s *ngFor in pyscript?

I am playing with Pyscript for the first time and I am trying to create a DOM element for each element in an array, similar to the *ngFor directive in Angular. Is there any way to achieve this?

JavaScript

Advertisement

Answer

I am trying to create a DOM element for each element in an array

To append a new DOM element, use the append=True parameter

JavaScript

The signature for pyscript.write

JavaScript

Source for pyscript.write link

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement