Last active
July 19, 2016 11:36
-
-
Save gbrault/af65a0455a87755151ee4c7509415b02 to your computer and use it in GitHub Desktop.
How to call functions or watch variables in NODE-RED UI (angular.js)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
(function(scope) { | |
scope.name = "Here I am!!!"; | |
/* scope.fun = function(val){alert(val);return val}; */ | |
scope.$watch('msg.payload', function(newValue, oldValue) { | |
/* Do something clever here */ | |
if(!angular.equals(newValue, oldValue)){ | |
alert(newValue); | |
} | |
}); | |
})(scope) | |
</script> | |
{{name+" "+msg.payload}} | |
<!-- {{fun(name)}} --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment