{"size": 1125, "ext": "js", "max_stars_repo_path": "public/build/js/controllers/projectNote/projectNoteNew.js", "max_stars_repo_name": "marioAquinoJF/laravelAngular", "max_stars_repo_stars_event_min_datetime": "2015-12-22T17:33:39.000Z", "max_stars_repo_stars_event_max_datetime": "2015-12-22T17:33:39.000Z", "max_issues_repo_path": "resources/assets/js/controllers/projectNote/projectNoteNew.js", "max_issues_repo_name": "marioAquinoJF/laravelAngular", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "resources/assets/js/controllers/projectNote/projectNoteNew.js", "max_forks_repo_name": "marioAquinoJF/laravelAngular", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 37.5, "max_line_length": 102, "alphanum_fraction": 0.3928888889}
angular.module('app.controllers')
        .controller('ProjectNoteNewController', ['$scope', '$location', '$routeParams', 'ProjectNote',
            function ($scope, $location, $routeParams, ProjectNote) {
                $scope.project_id = $routeParams.id;
                
                $scope.projectNote = new ProjectNote({id: $routeParams.id});
                $scope.save = function () {
                    $scope.projectNote.project_id = $scope.project_id;
                    $scope.projectNote.$save().then(
                            function () {
                                $location.path('/project/' + $routeParams.id + '/notes');
                            });

                };
                $scope.formateName = function (id) {
                    if(id){
                        for(var i in $scope.clients){
                            if($scope.clients[i].id == id){
                                return $scope.clients[i].name;
                            }
                        }
                    }
                    return 'erro';
                };
            }

        ]);


