How can I allow multiple controllers to use one template with controllerAs syntax?
<p>Say I have the following controllers:</p>

<pre><code>function MainController() {
  this.hello = function() {
    // does stuff
  }
}

function AnotherController() {
  this.hello = function() {
    // does other stuff
  }
}
</code></pre>

<p>where controllerAs for MainController is set as <code>mainController</code> and controllerAs for AnotherController is <code>anotherController</code>. Now say I have the following template:</p>

<pre><code>&lt;div ng-click="mainController.hello()"&gt;&lt;/div&gt;
</code></pre>

<p>Is it possible to allow <code>AnotherController</code> to use this template as well? How can I do that? </p>

<p>EDIT** To clarify, I have two different views calling this template. Whenever the main view calls the template I want the template to be </p>

<pre><code>&lt;div ng-click="mainController.hello()"&gt;&lt;/div&gt;
</code></pre>

<p>but when the other template calls it I want it to be</p>

<pre><code>&lt;div ng-click="anotherController.hello()"&gt;&lt;/div&gt;
</code></pre>

<p>I don't want to have two templates because almost everything in the template remains the same except for ng-click.</p>