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: Daten verwalten

05.01.2021 (👁2831)


 

Wo definiert man die Daten und wie zeigt man die Daten an

 

Die Daten werden in der app.component.ts definiert

Beispiel: mehrere Aufgaben in einer Tabelle oder Array wie Datenmenge  =[‘a‘,‘b‘,‘c‘]

 

aufgaben=['Aufgabe1','Aufgabe2','Aufgabe3'];

 

Und zeigt diese in der app.compontent.html

 <li *ngFor="let aufgabe of aufgaben">{{aufgabe}}</li>

 

 

Definieren in der .ts

 

Anzeigen in der .html

Und in der Ausgabe app.component.html

 

 

Erzeugt als Ausgabe in html

dailycheck

  • Aufgabe1
  • Aufgabe2
  • Aufgabe3

 

 

 

 

 

Daten definieren in app.compontent.ts

Definitions Code in app.component.ts

import { Component } from '@angular/core';

import { AngularFireModule  } from 'angularfire2';

@Component({

  selector: 'app-root',

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

  styleUrls: ['./app.component.css']

})

export class AppComponent {

  //--< Daten >--

  title = 'dailycheck';

  aufgaben=['Aufgabe1','Aufgabe2','Aufgabe3'];

  //--</ Daten >--

  constructor(af:AngularFireModule) {

    console.log(af);

    

  }

}

 

 

 

Datenb Anzeigen in app.compontent.html

Ausgabe Code in der .html

<h1>{{title}}</h1>

<ul>

  <li *ngFor="let aufgabe of aufgaben">{{aufgabe}}</li>

</ul>