title: Angular4 - clean code, how to don't duplicate code
body: <p>my questions is about good practice to write clean code in angular 4.</p>
  
  <p>I have two components - client and host, their are pretty similar, both have some <code>&lt;video&gt;</code> element and both have similar code for handle this <code>&lt;video&gt;</code> element. </p>
  
  <p>So what is the best way to implement this without duplicating code in this two components?</p>
  
  <p>Remember if I will create another component for example video-component and then I will have in this <code>&lt;video&gt;</code> I must supply some public functions to turn on, off camera, microphone, start stream, close stream, etc... 
  There are a few functions that I have to run from Client/Host-Component in my new Video-Component.</p>