How to set the initial text in a Text Box in code?

Posted by wes.rector on 11-Jul-2018 12:35

KUIB 3, AngularJS app. I have a Text Box on a blank view. How can I set an initial value for the Text Box in code? Here's code that does not work in onShow:

this.$scope.$watch(() => {
    return this.$components.textbox0;
}, (newValue, oldValue) => {
    if (newValue) {
        newValue.value = 'some text that varies by user';
    }
});

All Replies

Posted by jquerijero on 11-Jul-2018 15:15

Are you using the ng-model keyword? It should normally look like this.

$component.ng-model_name = 'some text that varies by user';

This thread is closed