Skip to main content
18-Opal
April 18, 2018
Question

Where do I learn about scope?

  • April 18, 2018
  • 1 reply
  • 2807 views

You can use the scope in ThingWorx Studio to modify the properties of a widget or the parameters of an application.

 

For example, to modify the value of a variable called value through js:
$ scope.app.params.value = "";
For a widget it looks like this:
  $ scope.app.fn.triggerWidgetService ('popup-1', 'showpopup');
  $ scope.view.wdg ['model-1'] ['sequence'] = "";

 

Where do I check for the app that I call after scope, or something like view, fn, wdg?


If you have a tutorial on which class or function should appear when using scope, please share it.

 

 

thankใ„ด

1 reply

5-Regular Member
April 20, 2018

@CHASEONHO $scope is the application object (the owner of application variables and functions).
JavaScript has two scopes โ€“ global and local. Any variable declared outside of a function belongs to the global scope, and is therefore accessible from anywhere in your code. Each function has its own scope, and any variable declared within that function is only accessible from that function and any nested functions.

Scope is something generic and I believe we do not have a list or documentation on the request.

-Durgesh