import { Injectable } from '@angular/core' ; import { Contact } from '../core/contact' ; import { LogService } from './log.service' ; @ Injectable ( ) export class ContactFactoryService { constructor ( private logService ) { } createContact ( jidPlain , name ? , avatar ? ) { if ( ! name ) { name = jidPlain ; } return new Contact ( jidPlain , name , this . logService , avatar ) ; } }