title: variable is used before its initialization
body: <p>i want to initally assign updateName to shipment object name property but it is giving the error Property 'shipment' is used before its initialization.</p>
  <pre><code>export class ShipmentInfoComponent implements OnInit {
    shipment: any;
    updateName = this.shipment.name;
    constructor(
      private route: ActivatedRoute,
      private location: Location,
      private shipmentService: ShipmentService
    ) {}
  
    ngOnInit(): void {
      this.getShipment();
    }
    getShipment(): void {
      const id = this.route.snapshot.paramMap.get('id');
      this.shipmentService.getShipment(id).subscribe((shipment) =&gt; {
        this.shipment = shipment;
      });
    }
    toUpdateName(): void {
      const id = this.route.snapshot.paramMap.get('id');
      if (this.updateName !== '') {
        this.shipmentService
          .updateName(id, this.updateName)
          .subscribe((shipment) =&gt; {
            this.shipment = shipment;
          });
      }
    }
  }
  </code></pre>