Skip to main content
1-Visitor
July 8, 2019
Solved

Bindings at runtime

  • July 8, 2019
  • 1 reply
  • 1156 views

Is it possible to create bindings with js during runtime?

Best answer by RolandRaytchev

Hi @cmodin ,

 

The answer is actually  No …  but in some cases also  YES.

No because we can create the structure what is behind the user interface. This means we cannot create with javaScript the binding what we can see on the bottom of GUI of studio.

But in same case is possible, because in some cases we can use a $watch javaScript /angular construct to create bindings between properties.

Example:

 $scope.$watch("view.wdg['sequence']['text']", function() {
 $scope.view.wdg['model-1']['sequence'] = $scope.view.wdg['sequence'].text; 
} );

So this will create a dynamic binding  - when the property 'text' of the  widget with the name 'sequence' will change it will set the it to the ‘sequence' property of the model widget with the name 'model-1' 

 

 

1 reply

21-Topaz I
July 17, 2019

Hi @cmodin ,

 

The answer is actually  No …  but in some cases also  YES.

No because we can create the structure what is behind the user interface. This means we cannot create with javaScript the binding what we can see on the bottom of GUI of studio.

But in same case is possible, because in some cases we can use a $watch javaScript /angular construct to create bindings between properties.

Example:

 $scope.$watch("view.wdg['sequence']['text']", function() {
 $scope.view.wdg['model-1']['sequence'] = $scope.view.wdg['sequence'].text; 
} );

So this will create a dynamic binding  - when the property 'text' of the  widget with the name 'sequence' will change it will set the it to the ‘sequence' property of the model widget with the name 'model-1'