JSFiddle - React, Tailwind, and code Playground
HTML
<div ng-app="myApp" ng-controller="myController">
<div ng-repeat="item in items">{{item}}</div>
</div>
JavaScript
var app = angular.module('myApp', []);
app.controller('myController', function($scope){
$scope.items = ["John","Bob","Tanya","Owen","George","Completed"];
$scope.fixArray = function(array, name){
angular.forEach(array, function(a){
if (a == name){
alert(name);
$scope.index = array.indexOf(a);
}
});
array.unshift(array[$scope.index]);
array.splice($scope.index + 1, 1);
};
$scope.fixArray($scope.items, "Completed");
});