Commit 1c14350a authored by S Anand's avatar S Anand
Browse files

DOC: Release version 0.2.2

parent d7c653e8
Pipeline #38085 passed with stage
in 1 minute and 17 seconds
......@@ -382,6 +382,9 @@ g1.url.parse('/?a=1&b=2&c=3&d=4') // Update this URL
- `0.2.1`:
- [$.template](#template) triggers a `template` event with the data and target nodes.
It also accepts a `src=` attribute that points to a template file.
- `0.2.2`:
- [$.template](#template) can be applied to a container element like `body`. It supports
`data-selector=` which defaults to `script[type="text/html"]`
# Release
......
{
"name": "g1",
"version": "0.2.1",
"version": "0.2.2",
"description": "Gramex 1.x interaction library",
"license": "UNLICENSED",
"author": "S Anand <s.anand@gramener.com>",
......
  • @s.anand -- do we plan to support nested templates?

  • @pratap.vardhan - this already should support nested templates like this:

    <h1>This is a <%= 'template' %></h1>
    <script type="text/html" class="inner-template">
      <%= 1 + 2 %>
    </script>
    <script>
      $('.inner-template').template()
    </script>

    ... the nested template is rendered. (I think. Haven't tested it.)

  • @s.anand -- thought so, have checked above snippet, doesn't seem to work.

    And, to be clear, I'm referring to reusing templates declared once can be used all across the body. I believe earlier we used to cache templates and call them with template IDs?

    Edited by Pratap Vardhan
  • @pratap.vardhan - yes. The snippet I shared is flawed because it relies on a </script> inside a </script> tag which HTML does not allow.

    Instead, this is fixed via 99318a5d

Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment