title: Is it possible to let Angularjs work with prototype methods and variables
body: <p>You know, in angularjs, most of logical are based on <code>$scope</code>:</p>
  
  <pre><code>function Ctrl($scope) {
      $scope.name = "Freewind";
      $scope.hello = function() {
         alert($scope.name);
      }
      $scope.method1 = function() {}
      $scope.method2 = function() {}
      $scope.method3 = function() {}
      $scope.method4 = function() {}
      $scope.method5 = function() {}
  }
  </code></pre>
  
  <p>Now I'm using haxe to generate angularjs code, it works if my code is:</p>
  
  <pre><code>class Ctrl {
     public function new(scope:Scope) {
        scope.name = "Freewind";
        scope.hello = function() {
           alert(scope.name);
        }
        scope.method1 = function() {}
        scope.method2 = function() {}
        scope.method3 = function() {}
        scope.method4 = function() {}
        scope.method5 = function() {}
     }
  }
  
  typedef Scope = {
      name:String,
      hello:Void-&gt;Void,
      method1: Void-&gt;Void,
      method2: Void-&gt;Void,
      method3: Void-&gt;Void,
      method4: Void-&gt;Void,
      method5: Void-&gt;Void
  }
  </code></pre>
  
  <p>But I want to be benefited from haxe's class system(the code may be simpler and clearer), to declare it like:</p>
  
  <pre><code>class Scope {
      public var name:String;
      public function hello() {}
      public function method1() {}
      public function method2() {}
      public function method3() {}
      public function method4() {}
      public function method5() {}
  }
  </code></pre>
  
  <p>Then find a way to associate the <code>Scope</code> class with the <code>$scope</code> of angularjs.</p>
  
  <p>But the generated <code>Scope</code> from haxe are using prototypes:</p>
  
  <pre><code>Scope = function();
  Scope.prototype.name = "something";
  Scope.prototype.hello = function() {}
  Scope.prototype.method1 = function() {}
  Scope.prototype.method2 = function() {}
  Scope.prototype.method3 = function() {}
  Scope.prototype.method4 = function() {}
  Scope.prototype.method5 = function() {}
  </code></pre>
  
  <p>In this case, I can't find a solution to let angularjs work with it.</p>
  
  <p>Is it possible to let angularjs to work with prototypes, so it can work with haxe class system (also other languages like coffeescript/typescript which have class support)? </p>