in Education by
I get data from socket io this JSON every 10 sec.. data { "nr": "1" } data { "nr": "2" } . . . . data { "nr": "5555" } I have this function in ts: .... mydata:any; constructor(private zone:NgZone) { super() } .... socketIO.on('hello', (data) => { this.zone.run(()=> { console.log('data', data); this.mydata= data; }); }); in html Nativescript:
Now, the problem is in view, I want to print in view all data, 1, 2, 3, 4,..., 5555 not only end of point 5555 Any idea please how to print all data? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
You have to convert mydata into an array. HTML <!-- json pipe just neatly outputs the data --> <!-- Or to list items one by one ---> TS .... mydata:any = []; constructor(private zone:NgZone) { super() } .... socketIO.on('hello', (data) => { this.zone.run(()=> { console.log('data', data); this.mydata.push(data); }); }); Note:
tag is invalid in {N} environment

Related questions

0 votes
    Step 1: server I've created a simple server with Node & Socket.io which declares a namespace under ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 3, 2022 in Education by JackTerrance
0 votes
    The idea is to create server in master process, and handle requests in workers. I want to utilize all ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jan 15, 2022 in Education by JackTerrance
0 votes
    I have a json file contains a icons object like this: "icons" : { "logo" : "fa fa-caret-down ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    I'm learning oop in python after learning it in Java. It happens that i'm trying to create an array from my class ... .name = name person1 = Person() person1.set_name("John") #...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    so with ng2 rc.6 I am getting an error of: Uncaught (in promise) Error: (SystemJS) SyntaxError: ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 8, 2022 in Education by JackTerrance
0 votes
    I have these routes /items/:id /items /items/:id/edit ... etc I want to put the component, to ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 3, 2022 in Education by JackTerrance
0 votes
    I have a mat-table with a component app-order-statuses on every row. the component calls the statuses ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 3, 2022 in Education by JackTerrance
0 votes
    I have an angular 7 project and I'm using Angular universal. Everything is working fine except when I ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 30, 2022 in Education by JackTerrance
0 votes
    I have these routes /items/:id /items /items/:id/edit ... etc I want to put the component, to ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 26, 2022 in Education by JackTerrance
0 votes
    I have a page with PrimeNG tree and an autocomplete field. My requirement is Tree should be expanded to ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 26, 2022 in Education by JackTerrance
0 votes
    I have a simple submit method, where Console.log(11) is printed first then console.log(1). I need ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 22, 2022 in Education by JackTerrance
0 votes
    I would like to dynamically assign a class to a specific cell in a table. An object in "cols" ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 21, 2022 in Education by JackTerrance
0 votes
    I have this template that I used everywhere in my project : {{ event.title }} {{ event.content } ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 19, 2022 in Education by JackTerrance
0 votes
    I have a simple submit method, where Console.log(11) is printed first then console.log(1). I need ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 19, 2022 in Education by JackTerrance
0 votes
    I would like to dynamically assign a class to a specific cell in a table. An object in "cols" ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 15, 2022 in Education by JackTerrance
...