title: Angular+TypeScript - pass parameter from view to controller
body: <p>I am using AngularJS with TypeScript and now I need to pass a parameter from view to controller. This is the way how I am trying to do it (via <strong>ng-init</strong>):</p>
  
  <pre><code>&lt;div class="col-md-9" ng-controller="MapIZSController" ng-init="init('IZS')"&gt;
  </code></pre>
  
  <p><code>"IZS"</code> value should be passed to controller. The controller looks like:</p>
  
  <pre><code>export class MapIZSController
  {
      static $inject = ["$scope", "leafletData"];
      private m_scope: IMapIZSScope;
      private m_leafletData;
  
      constructor($scope: IMapIZSScope, leafletData)
      {
          // the first way I tried
          $scope.init = function (type) {
              console.log("type is: " + type);
          };
          // the second way I tried
          $scope.init = this.init;
      }
  
      public init = (init: any) =&gt; {
          console.log("init is: " + init)
      } 
  </code></pre>
  
  <p>My problem is that I would like to obtain a type but </p>
  
  <ul>
  <li>the first way is never called and </li>
  <li>the second too. </li>
  </ul>
  
  <p>Can you give me some advice please?</p>