Skip to content

Instantly share code, notes, and snippets.

@LayZeeDK
Created October 10, 2018 14:38
Show Gist options
  • Save LayZeeDK/c179e807b2c7daa09e2ee3a33b30f10f to your computer and use it in GitHub Desktop.
Save LayZeeDK/c179e807b2c7daa09e2ee3a33b30f10f to your computer and use it in GitHub Desktop.
Heroes: Mixed component model after extracting a container component
import { Component } from '@angular/core';
import { Hero } from '../hero';
@Component({
selector: 'app-heroes',
templateUrl: './heroes.component.html',
styleUrls: ['./heroes.component.css']
})
export class HeroesComponent {
heroes: Hero[];
add(name: string): void {
name = name.trim();
if (!name) { return; }
}
delete(hero: Hero): void {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment