{"size": 1266, "ext": "js", "max_stars_repo_path": "controller/routerApp.controller.js", "max_stars_repo_name": "HimanshuKapoor/angular-friends-list", "max_stars_repo_stars_event_min_datetime": "2015-12-10T18:33:03.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-15T02:29:08.000Z", "max_issues_repo_path": "controller/routerApp.controller.js", "max_issues_repo_name": "HimanshuKapoor/angular-friends-list", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "controller/routerApp.controller.js", "max_forks_repo_name": "HimanshuKapoor/angular-friends-list", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 3, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 25.8367346939, "max_line_length": 90, "alphanum_fraction": 0.7077409163}
'use strict';
this.pointer=null;
this.addvalue=false;
this.viewctn=false;
this.editpointer=null;
var app = angular.module("routerApp");

app.controller('viewContact', function() {
this.contacts=[];
this.field={};    
 this.saveContact= function(index){
	if(this.pointer!=null) {
		this.contacts[this.pointer]=this.field; 
	}
	else {
		this.contacts.push(angular.copy(this.field)); 
	}
	this.field = {};
	this.pointer = null;
  }
  
 this.delContact= function(index) {
 this.contacts.splice(index,1);
 this.listcontact();
 }
 
 this.editContact = function(index) {
 // set value of field obj equal to c
 this.field.name=this.contacts[index].name;
 this.field.email=this.contacts[index].email;
 this.field.phone=this.contacts[index].phone;
 this.pointer=index;
 }
 this.add=function(){  //event to toggle + - 
 this.addvalue=!this.addvalue;
 }
 this.viewcontact= function(index) {  // will take you to the detail of contact
 this.viewctn=!this.viewctn;
 this.editpointer= index;
 }
 this.listcontact = function() { // will take you back to the list view of contacts
 this.viewctn=!this.viewctn;
 this.editpointer=null;
 }
 this.cancelContact = function() {  // cancel the contact form and toggle the contact form
 this.field = {};
 this.addvalue=!this.addvalue;
 }
});