This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Iterator interface | |
| interface Iterator<T> { | |
| next(): T | null; | |
| hasNext(): boolean; | |
| } | |
| // Aggregate interface | |
| interface IterableCollection<T> { | |
| createIterator(): Iterator<T>; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Component interface | |
| interface Coffee { | |
| cost(): number; | |
| description(): string; | |
| } | |
| // Concrete component | |
| class SimpleCoffee implements Coffee { | |
| cost(): number { | |
| return 5; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { NgModule } from '@angular/core'; | |
| import { BrowserModule } from '@angular/platform-browser'; | |
| import { AppRoutingModule } from './app-routing.module'; | |
| import { AppComponent } from './app.component'; | |
| import { FirstComponent } from './components/first/first.component'; | |
| import { SecondComponent } from './components/second/second.component'; | |
| @NgModule({ |