//Add element to front of array
var numbers = ["2", "3", "4", "5"];
numbers.unshift("1");
//Result - numbers: ["1", "2", "3", "4", "5"]
for(var i = 0; i<$scope.notes.length;i++){
if($scope.notes[i].is_important){
var imortant_note = $scope.notes.splice(i,1);
$scope.notes.unshift(imortant_note[0]);//push to front
}
}