Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Is there support for custom components?

ANSWERED

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.

Best Answer
1 BEST ANSWER

Accepted Solutions

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.

View best answer in original post

Best Answer
2 REPLIES 2

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.

Best Answer

Very cool work! Thanks for sharing. 🙂

Best Answer
0 Votes