Where does "settings.additionalParams.data" become "params.data"?

  • 1
  • Question
  • Updated 4 years ago
  • Answered
Hi,

I am trying to figure out how to use the data being passed into the Angular model from the settings page.

I have the text widget downloaded, and I am just trying to see if I can add a title to display above the text. I am to the point where I have added the text input to the settings page, and I can save the title data successfully. I can even see in the nwjs preview app that my title data is being saved in the Additional Parameters object, but I can't figure out how the title data goes from the new parameter I have added called "settings.additionalParams.title" to "params.title"

Is this an Angular thing that does this or something that your team has written? Should this be an automatic thing?

Thanks!
Photo of Stephen Garrett

Stephen Garrett, Champion

  • 2,674 Points 2k badge 2x thumb

Posted 4 years ago

  • 1
Photo of Stephen Garrett

Stephen Garrett, Champion

  • 2,674 Points 2k badge 2x thumb
I also can't seem to get my posts to go in the developer section.
Photo of Blake Freeman

Blake Freeman, Official Rep

  • 36,116 Points 20k badge 2x thumb
Stephen,

I've passed this one on to one of our developers and marked it as a developer thread. Someone should be back with you shortly.
Photo of Stuart Lees

Stuart Lees, Employee

  • 586 Points 500 badge 2x thumb
Hi Stephen,

If I understand correctly, you're looking to know how to retrieve the settings additionalParams object data from within the Widget code (not settings). 

You need to make an rpc call that will retrieve this data. Have a look in Text Widget here on how to make that call and here on how to parse it. 

Thanks
Photo of Stephen Garrett

Stephen Garrett, Champion

  • 2,674 Points 2k badge 2x thumb
Hi Stuart,

Thanks the quick response on this. So both of those things are happening in this gadgets file then?
... rvashow2.appspot.com/gadgets/gadgets.min.js

Is this part of the old gadgets code that is being done away with, or is this a RiseVision version of that code built for the new widgets? And is there a readable version of this code?
Photo of Stuart Lees

Stuart Lees, Employee

  • 586 Points 500 badge 2x thumb
Hi Stephen,

There is not a readable gadgets file but you can look to Googles Gadget API to reference more info regarding rpc, Prefs, etc - https://developers.google.com/gadgets/docs/reference/

Widgets are continuing to require the use of the gadgets.min.js for communication with the Viewer. 

Thanks
Photo of Stephen Garrett

Stephen Garrett, Champion

  • 2,674 Points 2k badge 2x thumb
Will widgets in the future be built the same way as the widgets on GitHub, or are you still going to be working out what the standard will be? I am looking at building some widgets for the company I work for, but I would like to make sure I learn the right things. 
Photo of Stuart Lees

Stuart Lees, Employee

  • 586 Points 500 badge 2x thumb
The current Widgets that are in the Store and on Github can be considered a standard for referring to when building your own Widgets.

Thanks
Photo of Stephen Garrett

Stephen Garrett, Champion

  • 2,674 Points 2k badge 2x thumb
Cool. Thanks for your help.