Angular-BookMonkey: Unterschied zwischen den Versionen

Aus Info-Theke
Zur Navigation springen Zur Suche springen
Zeile 1: Zeile 1:
= Links =
= Links =
* [[Angular]]
* [[Angular]]
* [https://github.com/Kylonas/BookMonkey Github-Quelle des Buchs]


= Schritte =
= Schritte =

Version vom 15. August 2021, 06:57 Uhr

Links

Schritte

ng new BookMonkey -p bm
# ... Angular routing: y
# Rest: leere Eingabe
npm install semantic-ui-css
  • Änderung in angular.json:
    • projects -> BookMonkey -> architect -> build -> options -> styles:
    • projects -> BookMonkey -> architect -> test -> options -> styles:
  "styles": [
    "node_modules/semantic-ui-css/semantic.css"
  ],
  • neues Interface
ng g interface shared/book
ng g component book-list
  • Anpassungen in booklist.component.html
  • Anpassungen in booklist.component.js
  • Eintrag in app.component.html: <bm-book-list></bm-book-list>

Komponente

  • Dekorator @Component
  • Initialisierung nicht im Konstruktor, sondern in ngOnInit(): void(){}
  • Alle Bausteine der Anwendung werden mittels @NgModule() in Angular-Modulen organisiert.
  • Eine Komponte muss immer in declarations eines Moduls registriert werden.