export class Model { constructor ( public id ) { this . id = id ; } set ( data ) { if ( data == null ) { return null ; } for ( const key in data ) { if ( this . hasOwnProperty ( key ) && key !== 'id' ) { this [ key ] = data [ key ] ; } } } isNew ( ) { return this . id == null ; } }