01-15-2018 21:02
01-15-2018 21:02
It would be super convenient if we could define and store our own custom components into /mnt/sysassets//widgets and import them into our applications. Is there support for that somehow?
It'd be nice to be able to reuse common patterns I find myself writing. Being able to compose a UI via building blocks like in ReactJS would be really awesome.
Answered! Go to the Best Answer.
01-15-2018 21:26
01-15-2018 21:26
Yes. It's called template symbols. The same mechanics which is used by the UI Components.
You can split template symbols definitions to separate gui files and include them in the similar way as standard components are imported.
<link rel="import" href="my_widget.gui" />
There's no official way to encapsulate JS logic at a time, so I created the small library which could help you to create subviews in BackboneJS style (Ionic Views).
There's no API to do the full-blown SVG DOM manipulations thus React-style frameworks are impossible. Nor it seems to be feasible with such a restricted JS runtime as Ionic's JerryScript is (it has no JIT). Unlike in modern browsers, in Ionic SVG DOM updates seems to be faster than comparing trees in memory.
01-15-2018 21:26
01-15-2018 21:26
Yes. It's called template symbols. The same mechanics which is used by the UI Components.
You can split template symbols definitions to separate gui files and include them in the similar way as standard components are imported.
<link rel="import" href="my_widget.gui" />
There's no official way to encapsulate JS logic at a time, so I created the small library which could help you to create subviews in BackboneJS style (Ionic Views).
There's no API to do the full-blown SVG DOM manipulations thus React-style frameworks are impossible. Nor it seems to be feasible with such a restricted JS runtime as Ionic's JerryScript is (it has no JIT). Unlike in modern browsers, in Ionic SVG DOM updates seems to be faster than comparing trees in memory.
01-19-2018 12:01
01-19-2018 12:01
Very cool work! Thanks for sharing. 🙂