title: Angular: ERROR Error: Uncaught (in promise): TypeError: Cannot read properties of undefined (reading 'forEach')
body: <p>I try execute on my cards.component.ts</p>
  <pre><code>    notices: notice[];
  
      ngOnInit() {
        this.dataService.getCards().subscribe( data =&gt; { this.notices = data });
        this.notices.forEach(n =&gt; {
          console.log('test')
        });
      }
  </code></pre>
  <p>I only want show something in console for every item is on &quot;notices&quot; but show me this error</p>
  <blockquote>
  <p>ERROR Error: Uncaught (in promise): TypeError: Cannot read properties
  of undefined (reading 'forEach')</p>
  </blockquote>