title: Conditional super() statement in Typescript
body: <p>I have a class which get instantiated by super(). In super() I want to send parameter based on some condition. But if I place if statement before super(), typescript gives compilation error saying super() must be the first statement.
  Is there any way I can achieve loading of the super class based on condition.</p>
  <p>Here is the code which is not working. I want to pass/block dependencies parameter(ENGINE_MODEL) in  super() based on some condition.
  Any idea how to achieve this?</p>
  <p>Code:</p>
  <pre><code>export class CreateChrStructureNodeControlComponent extends StructureNodeControl {
      constructor(private changeRequestCreateService: CreateChangeRequestService) {
      if(some condition = 'SF')  //my logic
          super(changeRequestCreateService,
              PLANT,
              ENGINE_MODEL);
      else 
           super(changeRequestCreateService,
              PLANT)
        ;
      }
  }
  </code></pre>
  <hr />
  <p>Superclass :</p>
  <pre><code>export class StructureNodeControl extends BaseTypeaheadControl&lt;TypeahaedLookupTableItem&gt; {
      constructor(changeRequestCreateService: CreateChangeRequestService, ...dependencies: string[]) {
          super(STRUCTURE_NODE,
              changeRequestCreateService.getStructureNodes,
              TypeahaedLookupTableItem,
              ...dependencies);
      }
  </code></pre>