Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Oct 25 2018 16:21

    fmalcher on master

    Fun with Observables BookStoreService: RxJS Routing (compare)

  • Oct 25 2018 11:12

    fmalcher on master

    Reactive Forms: Validierung Reactive Forms: Add Book (compare)

  • Oct 25 2018 09:06

    fmalcher on master

    HTTP Reactive Forms (compare)

  • Oct 25 2018 07:56

    fmalcher on master

    Kleinigkeiten Update NG7: ng update --all (compare)

  • Oct 24 2018 14:58

    fmalcher on master

    Pipes Oberflächentests mit Protractor BookStoreService mit statischen… (compare)

  • Oct 24 2018 12:09

    fmalcher on master

    Implementierung BookRatingServi… BookComponent: Buttons und Serv… Custom Event and 2 more (compare)

  • Oct 24 2018 06:58

    fmalcher on master

    BookRatingService + Tests (compare)

  • Oct 23 2018 13:38

    fmalcher on master

    Ressourcen Library generieren ng g librar… (compare)

  • Oct 23 2018 12:56

    fmalcher on master

    BookComponent, Property Binding… BooksModule SharedModule (compare)

  • Oct 23 2018 10:56

    fmalcher on master

    TypeScript: Klassen, Arrow Func… TypeScript: Module, Template St… Hello Webpack and 2 more (compare)

  • Oct 22 2018 18:55

    fmalcher on master

    ng new book-rating --routing --… (compare)

  • Oct 18 2018 20:54

    fmalcher on master

    Header auf Angular 7 aktualisie… (compare)

  • Oct 09 2018 11:16
    JohannesHoppe closed #1
  • Oct 09 2018 11:16

    JohannesHoppe on master

    Add Gitter badge Merge pull request #1 from gitt… (compare)

  • Oct 09 2018 11:13
    gitter-badger opened #1
Ferdinand Malcher
@fmalcher
module.exports = {
    entry: './main.ts',
    output: { filename: 'bundle.js' },
    resolve: {
        extensions: ['.ts']
    },
    module: {
        rules: [
            { test: /\.ts$/, loader: 'ts-loader' }
        ]
    },
    mode: 'development'
}
Ferdinand Malcher
@fmalcher
book.component.html
<div class="card mb-4">
  <div class="card-body bg-light">
      <img class="img-thumbnail float-right"
        src="//api.angular.schule/avatar/{{ book.rating }}">
    <div class="card-title">
      <h2>
        {{ book.title }}
        <span class="badge badge-secondary">{{ book.rating }}</span>
      </h2>
    </div>
    <p>{{ book.description }}</p>
  </div>
</div>
Ferdinand Malcher
@fmalcher
updateSortList(book: Book) {
    /* Alternativ:
    const cleanedList = this.books.filter(b => b.isbn !== book.isbn); // Filter erzeugt Kopie
    cleanedList.push(book);
    cleanedList.sort((a, b) => b.rating - a.rating);
    this.books = cleanedList;
    */

    this.books = this.books
      .map(b => b.isbn === book.isbn ? book : b)
      .sort((a, b) => b.rating - a.rating);

  }
Ferdinand Malcher
@fmalcher
search(term: string): Observable<Book[]> {
    return this.http.get<any[]>(`${this.apiUrl}/books/search/${term}`).pipe(
      map(rawBooks => rawBooks ? rawBooks : []),
      delay(3000)
      /*map(rawBooks => rawBooks.map(
        rawBook => this.mapToBook(rawBook))
      )*/
    );
  }