title: How can I call a function inside a function in Typescript?
body: <p>I have the following script:</p>
  
  <pre><code>/// &lt;reference path="updateAjax.ts" /&gt;
  /// &lt;reference path="updateSetUp.ts" /&gt;
  /// &lt;reference path="../../Shared/typescript/reference.ts" /&gt;
  
  module Admin.Grid {
  
      export function updateField(entity: string, $link: JQuery) {
  
          var link = new Link($link),
              idArr = $link.attr("id"),
              idTmp = idArr.split("_");
  
          link.AdminParams = Admin.Shared.getAdminParams(entity),
          link.Entity = entity;
          link.InputFieldType = $link.attr('id').split('_')[1];
          link.Row = idTmp[2],
          link.PartitionKey = $("tr[id='row_" + link.Row + "']").attr('data-pk'),
          link.RowKey = $("tr[id='row_" + link.Row + "']").attr('data-rk');
          link.InputFieldValue = $link.is(":checkbox") ? $link.is(":checked") : $link.val(),
  
          updateSetUp(link);
          updateAjax(link);
      }
  }
  </code></pre>
  
  <p>And in another file:</p>
  
  <pre><code>/// &lt;reference path="../../Shared/typescript/reference.ts" /&gt;
  
  module Admin.Grid {
  
      export function updateSetUp(link: Link) {
          $("#modified_" + link.Row).html('Updating');
          $("#modifiedBy_" + link.Row).html('Updating');
          $("#input_" + link.InputFieldType + "_" + link.Row)
              .next('span').remove().end()
              .after('&lt;span class="check-waiting"&gt;&lt;/span&gt;');
      }
  
  }
  </code></pre>
  
  <p>When the first script compiles to javascript <strong>I do not see any calls to updateSetup(link) or updateAjax(link)</strong></p>
  
  <p>I'm working in VS2012 with web essentials. I get no error messages or red underline. As far as I can see all my links are correct. Deleting the files and recreating makes no difference.</p>
  
  <p>Here's the javascript that's produced:</p>
  
  <pre><code>var Admin;
  (function (Admin) {
      (function (Grid) {
          function updateField(entity, $link) {
              var link = new Link($link);
              var idArr = $link.attr("id");
              var idTmp = idArr.split("_");
  
              link.AdminParams = Admin.Shared.getAdminParams(entity) , link.Entity = entity;
              link.InputFieldType = $link.attr('id').split('_')[1];
              link.Row = idTmp[2] , link.PartitionKey = $("tr[id='row_" + link.Row + "']").attr('data-pk') , link.RowKey = $("tr[id='row_" + link.Row + "']").attr('data-rk');
              link.InputFieldValue = $link.is(":checkbox") ? $link.is(":checked") : $link.val() , Grid.updateSetUp(link);
              Grid.updateAjax(link);
          }
          Grid.updateField = updateField;
      })(Admin.Grid || (Admin.Grid = {}));
      var Grid = Admin.Grid;
  
  })(Admin || (Admin = {}));
  </code></pre>