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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Is there a better way to exchange FILEURL with JS

EB_9781810
5-Regular Member

Is there a better way to exchange FILEURL with JS

Is there a better way to exchange FILEURL with JS?

 

I was able to change it by creating a global variable and linking it to the file url path, but I wonder if there is a more optimized way?

 

NOW: $scope.app.params.stepPDF = "app/resources/Uploaded/Procedimento1.PNG";

 

1 ACCEPTED SOLUTION

Accepted Solutions

Binding to an app param is good and can help if you are having UI update issues. Using app.param is a useful approach.

 

Going forward I have started using 

 

$scope.setWidgetProp("Your widget name" , "attribute name" , value)

 

and

 

$scope.getWidgetProp ("Your widget name" , "attribute name")

 

as opposed tp

 

$scope.view.wdg["Text-1].text = "some text";

 

The set and get are higher functions and do additional work  

 

View solution in original post

3 REPLIES 3

You could do setWidgetProp but am unsure of the use model below shows the syntax where src is the property name 

 

$scope.setWidgetProp("YourWidgetStudioID", "src", "app/resources/Uploaded/Procedimento1.PNG");

 

Maybe we need a little more info on what your are trying to achieve.

 

 

EB_9781810
5-Regular Member
(To:sgreywilson)

I am changing the fileurl of a 2D "File" widget according to the switch case, as I am currently doing it is working and it works with a global variable linked in the fileurl, but I wonder if there is any other way to conform to good usage practices.

Binding to an app param is good and can help if you are having UI update issues. Using app.param is a useful approach.

 

Going forward I have started using 

 

$scope.setWidgetProp("Your widget name" , "attribute name" , value)

 

and

 

$scope.getWidgetProp ("Your widget name" , "attribute name")

 

as opposed tp

 

$scope.view.wdg["Text-1].text = "some text";

 

The set and get are higher functions and do additional work  

 

Top Tags