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

Count
Followers 0
Login Register as User

Angular Error app.component.html error TS2341: Property firebase_Data is private and only accessible within class AppComponent

07.01.2021 (πŸ‘4120)

Angular Fehlermeldung

Angular Error: src/app/app.component.html:3:29 - error TS2341: Property 'firebase_Data' is private and only accessible within class 'AppComponent'.

 

    Error: src/app/app.component.html:3:29 - error TS2341: Property 'firebase_Data' is private and only accessible within class 'AppComponent'.

 

    3     <li *ngFor="let item of

firebase_Data

">

                                  ~~~~~~~~~~~~~

 

     

src/app/app.component.ts

:8:16

        8   templateUrl: './app.component.html',

                         ~~~~~~~~~~~~~~~~~~~~~~

       

Error occurs in the template of component AppComponent.

 

Ursache:

Eine Variable die mit Angular in der Webseite angezeigt werden soll, ist in der .ts typescript Datei nicht als public declariert

 

private firebase_Data;

 

 

 

LΓΆsung

Man muss die Variablen in der app.component.ts mit public declarieren

In der app.component.ts die variable als pulic deklarieren

export class AppComponent {

  //--< Daten >--

  title = 'dailycheck';

  public firebase_Data;

 

Dann kann eine Variable in der app.component.html angezeigt werden