web-dave / angular-starter-v2

6 stars 3 forks source link

fix book-edit #24

Open web-dave opened 7 years ago

web-dave commented 7 years ago
web-dave commented 7 years ago

book-edit.component.ts


import { Component, OnInit, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';
web-dave commented 7 years ago

book-edit.component.ts


constructor(
    private booksService: BooksService,
    private router: Router,
    private route: ActivatedRoute,
    private cd: ChangeDetectorRef) { }
web-dave commented 7 years ago

book-edit.component.ts


        this.booksService.getBook(params.isbn)
          .subscribe(b => {
            this.book = b;
            this.cd.markForCheck();
          });