Skip to main content

All Questions

Filter by
Sorted by
Tagged with
11 votes
1 answer
7k views

Getting Function.prototype.bind.apply(...) is not a constructor error

I am trying to simulate Controller Inheritance in AngularJS (1.6.9), but I am getting an error on console as : Function.prototype.bind.apply(...) is not a constructor Here is the HTML file: <!-- ...
user avatar
2 votes
1 answer
475 views

Inheritance w/ Angular's 'Controller As' vs. $scope

tl:dr; I want to consider the 'controller as' approach to simplify my inheritance process however I see some pitfalls around dependency injection and use in directives. preface I've been working on a ...
jusopi's user avatar
  • 6,813
7 votes
2 answers
6k views

Angularjs Typescript Controller Inheritance and Dependency Injection

I am trying to create a set of Controller classes which are derived from a base class that have many dependencies. Every time I want to create a derived class I have to copy the base class constructor ...
devman81's user avatar
  • 767
2 votes
2 answers
1k views

Is controller inheritance a good practice in AngularJS?

I am new to AngularJS and i don't know if "Is controller inheritance a good practice in AngularJS?". I mean that if I have 2 almost the same controllers like here: someModule.controller('...
Agroc's user avatar
  • 31
4 votes
1 answer
4k views

Cannot extend angularjs controller in typescript

I am trying to inherit an angularjs controller using Typescript's extends. But as soon as I extend the controller angularjs throws this error: Error: Argument 'GenericLookupCtrl' is not a function, ...
Haris's user avatar
  • 721
201 votes
9 answers
91k views

Can an AngularJS controller inherit from another controller in the same module?

Within a module, a controller can inherit properties from an outside controller: var app = angular.module('angularjs-starter', []); var ParentCtrl = function ($scope, $location) { }; app.controller(...
Federico Elles's user avatar