title: AngularJs+TypeScript:- How to assign the value of a variable to textfield
body: <p>I have taken two div one is left aligned and second is right.In both div i am having a textbox.I gave a ng-href on which i am trying to copy the data of left div to right div but it's not going in that way.It doesn't do anything.
  Here is my HTML Code:-</p>
  
  <pre><code>&lt;div data-ng-app="CustomerNew" data-ng-controller="CreateCustomerCtrl as custom" data-ng-init="getFormData();data();"&gt;
      &lt;div id="div1" align="left"&gt;
      &lt;tr&gt;
       &lt;td style="width: 200px"&gt;First Name:&lt;/td&gt;
      &lt;td&gt;
      &lt;asp:TextBox ID="txtFirstName" TabIndex="1" runat="server" CssClass="NormalTextBox"Width="160px" Height="10px" Name="txtFirstName" ng-model="custom.txtFirstName"&gt;&lt;/asp:TextBox&gt;
      &lt;/td&gt;
      &lt;/tr&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;div id="Div2" align="Right"&gt;
  &lt;tr&gt;
  &lt;td colspan="2" width="100"&gt;
  &lt;a ng-href="" Width="147px" style="cursor:pointer;" TabIndex="12" 
  ng-click="ButtonCopy(custom.txtFirstName)"&gt;Copy Contact Info&lt;/a&gt;
  &lt;/td&gt;
  &lt;/tr&gt;
   &lt;tr&gt;
  &lt;td style="width: 200px"&gt;First Name:&lt;/td&gt;
  &lt;td&gt;
  &lt;asp:TextBox ID="txtFirstNameBilling" TabIndex="12" runat="server" CssClass="NormalTextBox"Width="160px" Height="10px" ng-model="custom.txtFirstNameBilling"&gt;&lt;/asp:TextBox&gt;
  &lt;/td&gt;
  &lt;/tr&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Assignment OF Values:-</p>
  
  <p></p>
  
  <pre><code>    /// &lt;reference path="../interface/interface.ts" /&gt;
      /// &lt;reference path="../../scripts/typings/jquery/jquery.d.ts" /&gt;
      /// &lt;reference path="../../scripts/typings/angularjs/angular.d.ts" /&gt;
  
      module CustomerNew.controllers {
          export class CreateCustomerCtrl {
              static $inject = ['$scope', '$http', '$templateCache'];
              debugger;
              constructor(protected $scope: ICustomerScope,
                  protected $http: ng.IHttpService,
                  protected $templateCache: ng.ITemplateCacheService) {
                  $scope.ButtonCopy = this.ButtonCopy;
              }
       public ButtonCopy = (FirstName) =&gt; {
  this.$scope.txtFirstNameBilling = FirstName;
              }
              //end
          }
          var customerapp = angular.module("CustomerNew", []);
          customerapp.controller('CreateCustomerCtrl', CustomerNew.controllers.CreateCustomerCtrl);
      }
  </code></pre>
  
  <p></p>
  
  <p>My Interface
  </p>
  
  <pre><code>module CustomerNew {
      export interface ICustomerScope extends ng.IScope {
          ButtonCopy: (FirstName) =&gt; void;
      }
  }
  </code></pre>
  
  <p></p>
  
  <p>I have tried in the different way as suggested by Dean Ward too but new problem occurs</p>
  
  <p><img src="https://i.stack.imgur.com/W4CKy.jpg" alt="Error Image">
  Updated error2</p>
  
  <p>![enter image description here][2]</p>