+1 for reusing the same template in both client side and server side. For
that I think we need the support from UUF side.
If there is handebars helper method we defined such way that it will render
the server side template. But before doing that it copies an uncompiled
copy of the template to a <script> block.
{{#giveMeClientTemplate "idForTheTemplate"}}
<h1>{{userName}}</h1>
<p>{{userAge}}</p>
{{/giveMeClientTemplate}}
Looking in to the implementation of "raw-helper" handlebars helper might be
useful..
Just a suggestion. :)
thanks,
Chanaka
On Fri, Nov 11, 2016 at 3:44 PM, Yasima Dewmini <[email protected]> wrote:
> Hi Joseph,
>
> Thank you for your thought. Yes it would be great if we can re use those
> templates. I will have a chat with other members and come to a conclusion.
>
> Regards,
> Yasima
>
> On Fri, Nov 11, 2016 at 3:26 PM, Joseph Fonseka <[email protected]> wrote:
>
>> IMO it would be good if we can re-use the server side templates/partials
>> in the client side as well. This will allow us to render the initial page
>> in server-side and render the subsequent states in the client side. ( ex:
>> Reder a paginated list on the server-side and render subsequent page
>> changes in the client side ).
>>
>> Regards
>> Jo
>>
>> On Fri, Nov 11, 2016 at 2:42 PM, Yasima Dewmini <[email protected]> wrote:
>>
>>> Thank you Sajith for your input.
>>>
>>>
>>> On Fri, Nov 11, 2016 at 2:26 PM, SajithAR Ariyarathna <[email protected]
>>> > wrote:
>>>
>>>> UUF does not do client-side rendering (as per 1.0.0-m7 release). What
>>>> you can do is, put the Handlebars template (that you want in the
>>>> client-side) inside the public directory e.g.
>>>> .../public/templates/my-template.hbs
>>>> and in the client-side, get that template using AJAX and render it.
>>>>
>>>> On Fri, Nov 11, 2016 at 2:05 PM, Yasima Dewmini <[email protected]>
>>>> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I'm working on UUF for API Manager. I need to do some client-side
>>>>> rendering. The only solution I found is to have handlebar templates for
>>>>> the
>>>>> items that need to be rendered in client-side. My question is, is there
>>>>> any
>>>>> standard way to write those templates (Eg. inside public folder?)?
>>>>>
>>>>> OR
>>>>>
>>>>> Are there any other ways to achieve $subject?
>>>>>
>>>>> Any thoughts regarding this would be appreciated.
>>>>>
>>>>> Regards,
>>>>> Yasima.
>>>>>
>>>>> --
>>>>> http://wso2.com/signatureYasima Dewmini
>>>>> Software Engineer, WSO2, Inc.
>>>>> Email: [email protected]
>>>>> Mobile: +94713117081
>>>>>
>>>>> _______________________________________________
>>>>> Dev mailing list
>>>>> [email protected]
>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Sajith Janaprasad Ariyarathna
>>>> Software Engineer; WSO2, Inc.; http://wso2.com/
>>>> <https://wso2.com/signature>
>>>>
>>>
>>>
>>>
>>> --
>>> http://wso2.com/signatureYasima Dewmini
>>> Software Engineer, WSO2, Inc.
>>> Email: [email protected]
>>> Mobile: +94713117081
>>>
>>
>>
>>
>> --
>>
>> --
>> *Joseph Fonseka*
>> WSO2 Inc.; http://wso2.com
>> lean.enterprise.middleware
>>
>> mobile: +94 772 512 430
>> skype: jpfonseka
>>
>> * <http://lk.linkedin.com/in/rumeshbandara>*
>>
>>
>
>
> --
> http://wso2.com/signatureYasima Dewmini
> Software Engineer, WSO2, Inc.
> Email: [email protected]
> Mobile: +94713117081
>
--
Chanaka Jayasena
Associate Tech Lead,
email: [email protected]; cell: +94 77 4464006
blog: http://chanaka3d.blogspot.com
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev