Hi @twu,
Thanks for the screenshots.
Version A from your previous post yielded undefined because of sequence/timing issue. Just note that the $tm1Ui function, especially those you append a .then() are ‘promises’ which gets resolved at a later time.
So what happened on your version A is that it executes each lines up to console.log($scope.test.prop2);. But at the time it executes this line, the property $scope.test.prop2 has not been resolved yet, so you will just see undefined in the console.
If you wanted to check the actual value when it is available, you will have to do that within the function passed onto .then().
The last code I have sent is just to check if there is value being returned (empty string) or nothing at all (undefined).
So going back to the original question that you have, is this what you are looking for?
–
Paul