Readdy Write  
0,00 €
Your View Money
Views: Count
Self 20% 0
Your Content 60% 0

Users by Links 0
u1*(Content+Views) 10% 0
Follow-Follower 0
s2*(Income) 5% 0

Followers 0
Login Register as User

How to console.log a Observable Array [object Object]

16.03.2023 (πŸ‘122)

How to log a Observable Array


If you try to log a observable of a array than you will get:

console.log('data=' + data); 


[object Object]




Subscribe the observable and log the items




Following codes where tested

    findAll(): Observable <Article[]> {

      var data=from(this.articleRepository.find());

      //*LOG : [object Object]

      console.log('data=' + data);  //=data=[object Object]

      console.log(data); //Observable { _subscribe: [Function (anonymous)] }

      console.log(data.subscribe); //[object Object] Observable { _subscribe: [Function (anonymous)] } [Function (anonymous)]

      console.dir(data.subscribe); //[object Object] Observable { _subscribe: [Function (anonymous)] } [Function (anonymous)]


      //< OK >

      console.dir(data.subscribe(item=>console.log(item))); //*OK : [Article {guidarticle: '3',content_title: null,...          

      //</ OK >



      return data;


Ein Bild, das Text enthΓ€lt.

Automatisch generierte Beschreibung