oc
oc copied to clipboard
Allow re-render in the client-side with different parameters
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:
- When component is rendered like
<oc-component href="https://registry.com/my-component/1.x.x/?parameter=x¶meter2=y" data-name="my-component" ...>
...
</oc-component>
- and doing javascriptin the browser like
var $myComponent = $('oc-component[data-name="my-component"]');
oc.overrideParameters($mycomponent, { parameter: 'hello' });
oc.renderNestedComponent($mycomponent, callback);
- the component will re-render with href:
https://registry.com/my-component/1.x.x/?parameter=hello¶meter2=y