If I don't intend to inherit my controller class, is there any difference between defining an AngularJS Controller's methods as prototype methods over instance methods?
Coming from a C# background, I'm more comfortable with defining prototype methods. I also like keeping the constructor short.
However, most examples I see for AngularJS define methods at the instance level.
module Test {
angular
.module("app")
.controller("controller",
["$scope", MyController]);
export class MyController {
public Function1: () => {}
constructor(private $scope: IMyScope) {
//instance
this.Function1() = () => {
alert("Hello 1!");
}
}
}
//prototype
public Function2(): void {
alert("Hello 2!");
}
}