title: Angular duplicate construtor
body: <p>I have 4 components with 4 times the same construtor, being a beginner I don't know how to go about trying to do that differently, maybe do a service that includes what I call?</p>
  <p>What do you suggest to me and how to do it?</p>
  <p>The constructor code that appears on 4 components :</p>
  <pre><code>constructor(private transverseService: TransverseService, private webReferentielService: WebReferentielService) {
  
          this.transverseService.setLanguage(new Messages(this.webReferentielService));
          this.messages = this.transverseService.getMessages();
  
          transverseService.messageObservable.subscribe(
              msg =&gt; {
                  this.messages = msg;
              }
          );
  
          this.transverseService.initConfig().then(data =&gt; {
              this.configEnv = data;
              this.version = this.configEnv.version;
              this.env = this.configEnv.env;
          });
  
      }
  </code></pre>