controllers/NoticeController.js
/* Functions to decide whether to show edit options */
Functions to decide whether to show edit options
Functions to decide whether to show edit options
function updateCanEdit() {
                var userObj = $scope.user;
                if (userObj.positions) {
                    var editPositions = userObj.positions.edit_positions;
                    for (var editIndex in editPositions) {
                        if (editPositions[editIndex].id === $scope.notice.position_id) {
                            $scope.canEdit = true;
                            return;
                        }
                    }
                }
                $scope.canEdit = false;
            }
function updateCanEdit ( ) { var userObj = $scope . user ; if ( userObj . positions ) { var editPositions = userObj . positions . edit_positions ; for ( var editIndex in editPositions ) { if ( editPositions [ editIndex ] . id === $scope . notice . position_id ) { $scope . canEdit = true ; return ; } } } $scope . canEdit = false ; }
Functions to decide whether to show edit options
Functions to decide whether to show edit options