4 ms·
This is interesting. I have had a look at the examples. One question that comes to mind, how do you make a reusable component? Say I have: Part = { $cell: tru
by meekaaku 9y ago
This is interesting. I have had a look at the examples. One question that comes to mind, how do you make a reusable component? Say I have:
Part = {
$cell: true,
$type: "h2",
$text: "Part No: ",
}
Part is to be instantiated multiple times in the same page, but I want different $text. How do I pass this data?
- tmzt 9y agoIt seems to use functions for that purpose, look at the example with map. I really like the linked to Android/iOS implementation of this concept.
- meekaaku 9y agoOk. I found a way using factory: ItemMaker = function(data){ return { $cell: true, $type: "h1", style: "font-size: 100px;", $text: data, } } var i1 = ItemMaker('foo'); var i2 = ItemMaker('bar')