export class Product { id : number ; productName : string ; price : number ; static create ( id , product = { } ) { const newProduct = Object . assign ( new Product , { productName : 'New Product ' + id , price : 0 , ... product , id } ) ; return newProduct ; } }