Just trying out Amber with a toy app. It's looking fun, but it also looks like it lacks lot of things. Accessing documentation and examples is hard. This is not THAT bad though. What I'm stuck on currently is trying to add data attributes to an html element.
-- I just want to make a Bootstrap modal, so I have something like this:
Checking out the HTMLCanvas and TagBrush classes I can't seem to find any message relevant to adding data-attributes, but I might be missing something. You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
Federico Ramirez wrote:
> Just trying out Amber with a toy app. It's looking fun, but it also > looks like it lacks lot of things. Accessing documentation and examples > is hard. This is not THAT bad though. What I'm stuck on currently is > trying to add data attributes to an html element. > > I just want to make a Bootstrap modal, so I have something like this: > > || > renderOn:html > html div class:'modal fade';with:[ > html div class:'modal-dialog';with:[ > html div class:'modal-content';with:[ > html div class:'modal-header';with:[ > "how do I add the data attribute? Something like this would make sense" > html button class:'close';data:#{'dismiss' -> 'modal'} > ]. > ]. > ]. > ]. > > Checking out the HTMLCanvas and TagBrush classes I can't seem to find > any message relevant to adding data-attributes, but I might be missing > something. There isn't any, as far as I looked. Web package allows you to fill what you want by using jQuery, as if innermost block was: [ | btn | btn := html button. btn class: 'close'. btn asJQuery data: #{'dismiss' -> 'modal'} ] Unless you mean attributes, not data - they can be set easily with at:put:. Or you can add `data` and `data:` API to TagBrush yourself via extension methods of your app and just happily use it. Or add it to amber-contrib-web repo itself and issue a PR. Alternatively, if you do not care about old browsers, you can try to go with Silk / DOMite web libraries, and use `propAt: 'dataset'` and `propAt: 'dataset' put: ...`. > -- > You received this message because you are subscribed to the Google > Groups "amber-lang" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to [hidden email] > <mailto:[hidden email]>. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
In reply to this post by Federico Ramirez
Federico Ramirez wrote:
> Just trying out Amber with a toy app. It's looking fun, but it also > looks like it lacks lot of things. Accessing documentation and examples > is hard. This is not THAT bad though. What I'm stuck on currently is > trying to add data attributes to an html element. > > I just want to make a Bootstrap modal, so I have something like this: > > || > renderOn:html > html div class:'modal fade';with:[ > html div class:'modal-dialog';with:[ > html div class:'modal-content';with:[ > html div class:'modal-header';with:[ > "how do I add the data attribute? Something like this would make sense" > html button class:'close';data:#{'dismiss' -> 'modal'} should work here as well. > ]. > ]. > ]. > ]. > > Checking out the HTMLCanvas and TagBrush classes I can't seem to find > any message relevant to adding data-attributes, but I might be missing > something. > > -- > You received this message because you are subscribed to the Google > Groups "amber-lang" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to [hidden email] > <mailto:[hidden email]>. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
In reply to this post by Herby Vojčík
Ah I see, thanks a lot :)
-- On Monday, 6 February 2017 12:37:14 UTC-3, Herby wrote: Federico Ramirez wrote: You received this message because you are subscribed to the Google Groups "amber-lang" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. |
Free forum by Nabble | Edit this page |