oc icon indicating copy to clipboard operation
oc copied to clipboard

Allow re-render in the client-side with different parameters

Open matteofigus opened this issue 8 years ago • 0 comments

When a component is rendered inside a container, it would be nice to have a functionality for re-rendering it with different parameters (in an override mode).

My idea:

  1. When component is rendered like
<oc-component href="https://registry.com/my-component/1.x.x/?parameter=x&parameter2=y" data-name="my-component" ...>
...
</oc-component>
  1. and doing javascriptin the browser like
var $myComponent = $('oc-component[data-name="my-component"]');
oc.overrideParameters($mycomponent, { parameter: 'hello' });
oc.renderNestedComponent($mycomponent, callback);
  1. the component will re-render with href: https://registry.com/my-component/1.x.x/?parameter=hello&parameter2=y

matteofigus avatar Sep 26 '16 15:09 matteofigus