Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import {Component, Input} from '@angular/core';
selector: 'person',
template: '<h1>{{}} {{person.lastname}}</h1>'
export class PersonComponent {
private _person: any
set person(person: any){
if (person && person.hasOwnProperty('name')) {;
get person():any{
if (this._person && this._person.hasOwnProperty('lastname')) {
return this._person;
private capitalizeFirstLetter(word: string):string {
return word.charAt(0).toUpperCase() + word.slice(1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment