Tuesday, December 13, 2022

Angular - ng.ps1 cannot be loaded because running scripts is disabled on this system. ng server is not working, ng is not recognized.

 ng server is not working (ng is not recognized):


If ng serve is not recognized or not worked in out angular application we will get below error message in Terminal window.

Execute below command in Terminal.

Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted


Thursday, December 1, 2022

How to move item in an array to last position in javascript.

const arrayList = ['1', '2', '3', '5', '0'];
const moveThreeToEnd = (arrayList) => {
return arrayList.filter(item => item !== '3').concat(arrayList.filter(item => item === '3'))

}

console.log(array list); //['1', '2', '3', '5', '0' ];
console.log(moveThreeToEnd(array list)); // ['1', '2', '5', '0', '3'];