import { Injectable } from '@angular/core' ; @ Injectable ( { providedIn : 'root' } ) export class EntityService { clone < T > ( source ) { return Object . assign ( { } , source ) ; } merge = ( target , ... sources ) => Object . assign ( target , ... sources ) ; propertiesDiffer = ( entityA , entityB ) => Object . keys ( entityA ) . find ( key => entityA [ key ] !== entityB [ key ] ) ; }