I have been programming in Javascript for a while and I am quite comfortable with it. And I know the basic concept of prototypes and I have also used them a few times. But one thing I can't figure out is that when should a prototype be used.And what is the correct usage of prototypes. For example:Currently I am creating a Task Management system. Within this system you can create Projects, each project can then have multiple tasks added into it. Currently I have created the functionality of creating projects.All user projects are saved into a Array in my MongoDB database. Once a user creates a project it is added into the projects array. After that I created a getProjects function. This functions uses a GET request and retrieves all the projects for the logged-in user. Once the data is retrieved I save the projects array into an angular variable:CREATE Projects:  // Create Project Function $scope.createProject = function(id){    var pTitle = document.getElementById(pojectTitle).value;    console.log(Entered create Project fucntion);    console.log(user id is + id);    console.log(pTitle);    // Simple POST request example (passing data) :    $http.post(/createProject/+ id +, {        projectTitle: pTitle,        userID      : id    }).    success(function(data, status, headers, config) {        // this callback will be called asynchronously        // when the response is available        $scope.getProjects();        console.log(project created);        console.log(this is the response data  + data);    }).    error(function(data, status, headers, config) {        // called asynchronously if an error occurs        // or server returns response with an error status.    }); };GET Projects:$scope.getProjects = function(id) {   console.log(getting user projects, please wait ......);   // Simple GET request example (passing data) :   $http.get(/user/projects/ + id + , {   }).   success(function(data, status, headers, config) {       // this callback will be called asynchronously       // when the response is available       $scope.userProjects = data;       console.log(user projects are here  + $scope.userProjects);   }).   error(function(data, status, headers, config) {       // called asynchronously if an error occurs       // or server returns response with an error status.   }); };All the returning JSON data from the above request is saved in:   $scope.userProjects = [];Currently I am using angular's ng-repeat in my HTML file to loop through the userProjects array and create a Div for each project in the array (within ng-repeat). And in the centre of the div writer the name of the project. See below:Now here is my questionI want to make each div Clickable to when a user clicks on the div they are directed to another page where they can add tasks within the project.I thought about using Prototype functionality to attach links to each div. So my thought was that I would create Projects class in my angular controller and while I loop through the project array that was returned from the GET request, for each project in the array I will create an instance (object) of that class and attached a clickable event to each div. Is this a good approach?Is this a good use of prototype?Should I even be using prototypes?If not, what recommendations could you make?If you need more information to answer the question please let  me know.Thanks in advance.
When to use Prototypes & the correct usage of Prototypes ( Javascript )
design patterns;javascript;angularjs;prototyping