HUE-9394. [ui] Cannot pass complex data into web components (sree)

Review Request #15274 — Created June 26, 2020 and submitted

Sreenath
hue
master
HUE-9394
2839c13...
hue
johan, romain
commit c60d3b902ee1543fcf1726bb29f676816fb97e08
Author: sreenaths <sree@apache.org>
Date:   Sat Jun 27 02:23:09 2020 +0530

    HUE-9394. [ui] Cannot pass complex data into web components (sree)

:000000 100644 0000000000 efedb59edc A	desktop/core/src/desktop/js/ko/bindings/ko.webcomp.js
:100644 100644 26674ecfa1 bcad850989 M	desktop/core/src/desktop/js/ko/ko.all.js

Manual testing done by creating a test web component and passing complex data structures including a function as property.

  • 0
  • 0
  • 1
  • 0
  • 1
Description From Last Updated
johan
  1. 
      
  2. The idea is to not pass complex data to the components. Keep the data to a minimum, preferably just a few arguments that way they'll be easier to pick up by others.

    If you really need to pass ko data use data-bind instead. I.e.

    <my-component data-bind=attr: { 'data-foo': someObservable }"></my-component>

    1. Isn't passing the data as plain javascript object the only way to make the component generic for others to use?

  3. 
      
Sreenath
johan
  1. Ship It!
  2. 
      
romain
  1. Nice!

  2. 
      
Sreenath
  1. Ship It!
  2. 
      
Sreenath
Review request changed

Status: Closed (submitted)

Loading...