1 Non-following method:
I think you can achieve this somehow like this:
function ChildController($injector, $scope) {
$injector.invoke(ParentController, this, {
$scope: $scope
});
}
2 Prototypic inheritance
(ES5 browser support required)
angular.inherits = function (ctor, superCtor) {
ctor.super_ = superCtor;
ctor.prototype = Object.create(superCtor.prototype, {
constructor: {
value: ctor,
enumerable: false
}
});
};
Using:
function ChildController($scope) {
ChildController.super_.apply(this, arguments);
}
angular.inherits(ChildController, ParentController);
Code samples from here: https://github.com/exratione/angularjs-controller-inheritance
3 Get Typescript
, , $scope.
, , .
typescript, .