Show views
Stratox.js offers remarkable flexibility. You can use the same component view multiple times in various locations and with varying content.
How it works
1. Import
Let's start with importing a template view/component. I will begin with the easiest one: the ingress component.
2. Initialize instance
Create a class instance and pass a DOM element where you wish to show your template.
3. Add view
Now, add the view to the class instance and pass in the expected content object data to the view.
5. Execute
Execute and display the views/components in the expected DOM element.
5. The HTML
The HTML really just need a starting point but that depends completely on your need, building a app or enhancing a regular page.
6. The result
Combining multiple views
You can combine multiple views, both the same and different, in the same instance. Let's build upon the above example and add the ingress twice, combining them with a new table view:
Quick create and set component
Can also quick create and set component in one. The setComponent, argument 2 will also take a anonymous function like demonstrated below.
Now let's move on and take a look on how you can build custom templates.
Last updated