Get AngularJS at https://angularjs.org/.
See a demo of this code @plunker.
Services hold the business logic for an app. In order to increase readability and to enable reuse in another front-end framework the actual business logic is located in custom classes written in pure JavaScript. Services provide data (a Model) for the Controllers (View-Model).
Controllers connect the View (HTML Website) with the business logic in the Services (Model). Linking data or functions to the $scope object yields visibility for portions of the Controller's logic in the View.
JavaScript is an object oriented programming language.
Object are defined by their Protoypes and can be instanciated with
var a = new ClassName(constructor_param0, constructor_param1, ...);
.