194049 (2) [Avatar] Offline
#1
While processing through chapter 2, i encounterd the following error:
Error: Template parse errors:
Can't bind to 'stock' since it isn't a known property of 'summary'. ("
</header>
  <main class="mdl-layout__content" style="padding: 20px;" *ngIf="stocks">
    <summary [ERROR ->][stock]="stocks[0]"></summary>
  </main>
</div>
"): ng:///AppModule/AppComponent.html@10:13


summary.component.ts
import {Component, Input} from '@angular/core';

@Component({
  selector: 'app-summary',
  templateUrl: './summary.component.html',
  styleUrls: ['./summary.component.css']
})

export class SummaryComponent {
    @Input() stock: any;

  isNegative() {
    return (this.stock && this.stock.change < 0);
  }

  isPositive() {
    return (this.stock && this.stock.change > 0);
  }

}


194049 (2) [Avatar] Offline
#2
Well, I found it: its the app-summary selector smilie
jeremy.wilken (194) [Avatar] Offline
#3
That is right, the selector wasn't found which makes the binding error out. I guess the binding error shows up first, even though it would have also thrown an error on the unknown element.