You can put the "route.js" into a fragment (e.g. "router" fragment} and
include that fragment where ever you need, in a fragment or a page.
"router" fragment's HBS will look like this:

{{js "js/router.js"}}


In fact, instead of including the fragment in every place you can push the
"router" fragment into a zone (e.g. "contents") through bindings.

Regarding issue #14; we can do it and I have added that to UUF milestone
plan.

Thanks.

On Fri, Dec 23, 2016 at 4:48 PM, Chanaka Jayasena <chan...@wso2.com> wrote:

> Hi,
>
> Right now in APIM publisher implementation, we have a common client side
> javascript file (route.js) which we want share between a fragment
> "globalNavigation" and a page. This page is not including the above
> fragment. So we are keeping the route.js file in applications "public/js"
> folder.
>
> We include the route.js file from the fragment as follows.
>
> {{js "../../../components/root/base/js/route.js"}}
>
> Is there a better way to do this?
>
> FYI the {{js "js/route.js"}} is referring to the fragments public/js
> folder.
>
> ----------------
> Regarding the PR https://github.com/wso2/carbon-uuf-common/pull/12
>
> UUFClient.renderFragment method will be more useful if it can inject
> content in to a element in dom by providing a css selector or the object
> itself in the method calls parameter list. It make more sense to provide
> the above instead of the zone.
>
> I have created the following git issue https://github.com/wso2/
> carbon-uuf-common/issues/14
>
> thanks,
> Chanaka
>
>
> --
> Chanaka Jayasena
> Associate Tech Lead,
> email: chan...@wso2.com; cell: +94 77 4464006 <+94%2077%20446%204006>
> blog: http://chanaka3d.blogspot.com
>



-- 
Sajith Janaprasad Ariyarathna
Software Engineer; WSO2, Inc.;  http://wso2.com/
<https://wso2.com/signature>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to