cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Where do I learn about scope?

Highlighted
Level 12

Where do I learn about scope?

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

Re: Where do I learn about scope?

@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