Ionic Modify DOM Element

hi, i make an scanner app, okay let’s to the point, this is my code :

io3

i want to change html element value and img src attribute, thanks

You forgot to define the variables inside Your HomePage class. Try out following:

export class HomePage {

    protected title: String = new String();
    protected desc: String = new String();
    protected imgSrc: String = new String();

    constructor( ... ) { ... }

    protected scan(): void {
        /** ... */
        this.title = res.title;
        this.desc = res.desc;
        this.imgSrc = res.img;
        /** ... */
    }
}

Your binding for the variables looks good so far.

Let me know, if it worked.

Cheers
Unkn0wn0x

1 Like