title: Typescript and Angular Initialise objects in the constrcutror of the class, from other class type
body: <p>I have a simple case which just makes me nuts.</p>
  
  <pre><code>module PaymentType {
      export interface IPaymentTypeScope extends ng.IScope {
          PaymentTypeApprovals: PaymentTypeApproval[];
          FormatDate: Function;
  
     ....
  
          AuditTrailDialogObject: AuditTrailDialog;
  .....
      }
  
      export class PaymentTypeController {
  
          private _: UnderscoreStatic;
          private _scope: IPaymentTypeScope;
          private _log: ng.ILogService;
          private _q: ng.IQService;
          private _paymentTypeService: IPaymentTypeService;
          private _sce: ng.ISCEService;
  
          constructor($scope: IPaymentTypeScope, $log: ng.ILogService, paymentTypeService: PaymentType.IPaymentTypeService, $q: ng.IQService, $sce: ng.ISCEService) {
              this._paymentTypeService = paymentTypeService;
              this._scope = $scope;
              this._log = $log;
              this._q = $q;
              this._sce = $sce;
  
  
  
        ....
              this.InitialiseScope();
          }
  
          InitialiseScope = () =&gt; {
              this._scope.AuditTrailDialogObject = new AuditTrailDialog();
          }
  
        .......
  </code></pre>
  
  <p>I am trying to have an object of type AuditTrailDialog inside a method in the class. In that method I plan to set some properties of that dialog and then use it for binding.
  This code gives me an error - undefined is not a function in the point of initialising the object.
  If I do not initialise the object, I got an error - Cannot set property 'Title' of undefined.
  Please help what should I do so I can use the object of another class in my class and then use it for angular binding in the controller.
  Thanks</p>