01-02-2018 14:39
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

01-02-2018 14:39
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I am needing to display user information on my app screen and having some issues. Example - I want to display the users age.
In my app/index.js file, I have:
import { user } from "user-profile";
console.log(user.age); - DISPLAYS IN LOG
let userAge = JSON.stringify(user.age);
console.log(userAge); - DISPLAYS IN LOG
In my resources/index.gui file I have:
<text x="10%" y="70%" id="userAge"></text>
It displays nothing on the gui. I am sure I am missing something simple here.
Any help is appreciated.
Answered! Go to the Best Answer.

Accepted Solutions
01-03-2018 11:28
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

01-03-2018 11:28
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Thanks for your assistance. I was actually able to resolve it with the below:
let userAge = ("Age: " + user.age);
var age = document.getElementById("age");
age.text = userAge;

01-02-2018 18:59
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


01-02-2018 18:59
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
A visual element won't be updated just because it's got the same id as a variable name. You need code to make it happen.
This will be wrong (because off the top of my head); fixing it is left as an exercise to the developer:
let ageElement = document.getElementById("userAge"); ageElement.text = userAge;
Gondwana Software

01-03-2018 11:28
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

01-03-2018 11:28
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Thanks for your assistance. I was actually able to resolve it with the below:
let userAge = ("Age: " + user.age);
var age = document.getElementById("age");
age.text = userAge;

