Base Controller for Programming Gadgets
AngularJS provides a MVC framework to manage the business logic of a gadget. The base logic for programming a gadget should reside in the controller.js. The gadget framework binds the controller to the view file dynamically at runtime so that you do not have to mention the controller explicitly in the view using the data-ng-controller attribute.
In the gadget development framework, we have included a base controller (BaseController.js) which wires some of the required services to the controller. As a best practice, all AngularJS controller for a gadget should extend base controller. Though JavaScript does not provide inheritance directly, you can use JavaScript prototype inheritance.
Extending base controller provides a way to overload some of the functions defined in it. Functions in base controller provide a structured coding approach.