Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
Hello Ptc community,
I created a model and some javascript logic to show an image when a certain property is updated on a thing (on thingworx side). I would like if it is possible to associate a javascript function when a thing property auto refreshes.
Thanks a lot,
Frederico Silva
in case that your question is how to start some function when a value in TWX change - you can use:
.1) pay attention that the property will update in the Vuforia Experience project and has binding to an app parameter:
2.) use a watch block to watch the change of the app parameter:
//what the app parameter prop1
$scope.$watch('app.params.prop1', function (newValue, oldValue, scope) {
console.log("Old Value -befor it was changed =" + oldValue);
//! it could be undefined first time called
console.log("new Value -after it was changed =" + newValue);
//prints the current $scope (copy) object passed to the $watch construct
// pay attention that in this context it has no $ ! e.g. console.warn(scope);
//call your function / action which should do some tasks for
// the change of the prop1 app parameter
})