title: Including an Angular2 application to Asp.Net Webforms Page
body: <p>When I include my js files generated by angular-cli ng-build with aot configuration to my aspx page, I get an error in Chrome console that says;</p>
  
  <pre><code>&gt; TypeError: Error.parameterCount is not a function at
  &gt; Function$_validateParameterCount [as _validateParameterCount]
  &gt; (ScriptResource.axd?d=D9drwtSJ4hBA6O8UhT6CQj8wNIOSpDss44lOGYQrUvAlPdwlDclD9V49ignpuDN2RfK8PuhwsLDLLq…:118)
  &gt; at Function$_validateParams [as _validateParams]
  &gt; (ScriptResource.axd?d=D9drwtSJ4hBA6O8UhT6CQj8wNIOSpDss44lOGYQrUvAlPdwlDclD9V49ignpuDN2RfK8PuhwsLDLLq…:70)
  &gt; at String$startsWith
  &gt; (ScriptResource.axd?d=D9drwtSJ4hBA6O8UhT6CQj8wNIOSpDss44lOGYQrUvAlPdwlDclD9V49ignpuDN2RfK8PuhwsLDLLq…:491)
  &gt; at String.startsWith (es6.string.code-point-at.js:7) at
  &gt; MapSubscriber.project (GlobalLocationApi.js:138) at
  &gt; MapSubscriber._next (combineLatest.js:142) at
  &gt; MapSubscriber.Subscriber.next (Subscriber.js:89) at
  &gt; XMLHttpRequest.onLoad (xhr_backend.js:69) at ZoneDelegate.invokeTask
  &gt; (zone.js:171) at Object.onInvokeTask (ng_zone.js:210) at
  &gt; ZoneDelegate.invokeTask (zone.js:170) at Zone.runTask
  &gt; (vendor.bundle.js:56413) at XMLHttpRequest.ZoneTask.invoke
  &gt; (zone.js:224)
  </code></pre>
  
  <p>Package.json file;</p>
  
  <pre><code>{
    "name": "address-component",
    "version": "1.0.0",
    "license": "MIT",
    "angular-cli": {},
    "scripts": {
      "ng": "ng",
      "start": "ng serve",
      "lint": "tslint \"src/**/*.ts\" --project src/tsconfig.json --type-check &amp;&amp; tslint \"e2e/**/*.ts\" --project e2e/tsconfig.json --type-check",
      "test": "ng test",
      "pree2e": "webdriver-manager update --standalone false --gecko false",
      "e2e": "protractor",
      "extract-i18n": "cd src &amp;&amp; ng-xi18n",
      "ngbuildTr": "ng build --output-hashing=none --output-path=dist-AddressComponent/tr --aot --prod --i18n-file=src/i18n/messages.tr.xlf --i18n-format=xlf --locale=tr",
      "ngbuildTr-dev": "ng build --output-hashing=none --output-path=dist-dev-AddressComponent/tr --aot --dev --i18n-file=src/i18n/messages.tr.xlf --i18n-format=xlf --locale=tr",
      "ngbuild-dev": "npm run ngbuildTr-dev",
      "ngbuild": "npm run ngbuildTr",
      "build-dev": "npm install &amp;&amp; npm run ngbuild-dev",
      "build": "npm install &amp;&amp; npm run ngbuild"
    },
    "private": true,
    "dependencies": {
      "@angular/common": "^2.3.1",
      "@angular/compiler": "^2.3.1",
      "@angular/core": "^2.3.1",
      "@angular/forms": "^2.3.1",
      "@angular/http": "^2.3.1",
      "@angular/platform-browser": "^2.3.1",
      "@angular/platform-browser-dynamic": "^2.3.1",
      "@angular/router": "^3.3.1",
      "angular2-modal": "^2.0.2",
      "core-js": "^2.4.1",
      "ng2-auto-complete": "^0.10.9",
      "rxjs": "^5.0.1",
      "ts-helpers": "^1.1.1",
      "zone.js": "^0.7.7"
    },
    "devDependencies": {
      "@angular/compiler-cli": "^2.3.1",
      "@types/jasmine": "2.5.38",
      "@types/node": "^6.0.42",
      "angular-cli": "1.0.0-beta.25.5",
      "codelyzer": "~2.0.0-beta.1",
      "jasmine-core": "2.5.2",
      "jasmine-spec-reporter": "2.5.0",
      "karma": "1.2.0",
      "karma-chrome-launcher": "^2.0.0",
      "karma-cli": "^1.0.1",
      "karma-jasmine": "^1.0.2",
      "karma-remap-istanbul": "^0.2.1",
      "protractor": "~4.0.13",
      "ts-node": "1.2.1",
      "tslint": "^4.3.0",
      "typescript": "~2.0.3"
    }
  }
  </code></pre>
  
  <p>Angular trial aspx file;</p>
  
  <pre><code>&lt;%@ Page Title="Title" Language="C#" MasterPageFile="~/Master/Mobil.Master" Async="true" AutoEventWireup="true" %&gt;
  &lt;%@ Import Namespace="WebCore" %&gt;
  &lt;asp:Content ID="Content1" EnableViewState="false" ContentPlaceHolderID="head" runat="Server"&gt;
      &lt;asp:PlaceHolder ID="MetaPlaceHolder" EnableViewState="false" runat="server" /&gt;
      &lt;asp:Literal ID="ltCanonical" runat="server"&gt;&lt;/asp:Literal&gt;
      &lt;style type="text/css"&gt;
          table {
              border-spacing: 0;
          }
          .footer {
              display: none !important;
          }
          .glorious-header .header-row .header-navigation .bttn.orange {
              display: none;
          }
      &lt;/style&gt;
  
  &lt;/asp:Content&gt;
  &lt;asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"&gt;
      &lt;asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true"&gt;&lt;/asp:ScriptManager&gt;
  
      &lt;app-root-address-component addressConfigType="1"&gt;Loading...&lt;/app-root-address-component&gt;
  
  
       &lt;link href="../Javascript/angular/dist&lt;%= CountryOperation.GetEnvironment() %&gt;-AddressComponent/&lt;%= CountryOperation.GetLanguagePath() %&gt;/styles.bundle.css" rel="stylesheet" /&gt;
       &lt;script type="text/javascript" src="../Javascript/angular/dist&lt;%= CountryOperation.GetEnvironment() %&gt;-AddressComponent/&lt;%= CountryOperation.GetLanguagePath() %&gt;/inline.bundle.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="../Javascript/angular/dist&lt;%= CountryOperation.GetEnvironment() %&gt;-AddressComponent/&lt;%= CountryOperation.GetLanguagePath() %&gt;/vendor.bundle.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="../Javascript/angular/dist&lt;%= CountryOperation.GetEnvironment() %&gt;-AddressComponent/&lt;%= CountryOperation.GetLanguagePath() %&gt;/main.bundle.js"&gt;&lt;/script&gt;
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p>I noticed that if I remove "" line from aspx, it works perfectly but legacy code requires that declaration. Anybody else has this problem? How can I solve this? I'm out of options, thanks.</p>