Why powershell does not run Angular commands?

I have started to learn Angular but I note that powershell in Windows gives me an error whenever I make an angular command like: ng new new-app or ng serve this is the error what I got: ng : File C:\Users\< username >\AppData\Roaming\npm\ng.ps1 cannot be loaded because running scripts is disabled on this system. For … Read more

tslint / codelyzer / ng lint error: “for (… in …) statements must be filtered with an if statement”

Lint error message: src/app/detail/edit/edit.component.ts[111, 5]: for (… in …) statements must be filtered with an if statement Code snippet (It is a working code. It is also available at angular.io form validation section): for (const field in this.formErrors) { // clear previous error message (if any) this.formErrors[field] = ”; const control = form.get(field); if (control … Read more

How to add bootstrap to an angular-cli project

We want to use bootstrap 4 (4.0.0-alpha.2) in our app generated with angular-cli 1.0.0-beta.5 (w/ node v6.1.0). After getting bootstrap and its dependencies with npm, our first approach consisted in adding them in angular-cli-build.js: ‘bootstrap/dist/**/*.min.+(js|css)’, ‘jquery/dist/jquery.min.+(js|map)’, ‘tether/dist/**/*.min.+(js|css)’, and import them in our index.html <script src=”https://stackoverflow.com/questions/37649164/vendor/jquery/dist/jquery.min.js”></script> <script src=”vendor/tether/dist/js/tether.min.js”></script> <link rel=”stylesheet” type=”text/css” href=”vendor/bootstrap/dist/css/bootstrap.min.css”> <script src=”vendor/bootstrap/dist/js/bootstrap.min.js”></script> This worked … Read more

ng is not recognized as an internal or external command

Running windows 7 Professional 32bit. I tried running npm install -g angular-cli both under normal or admin. I also tried adding it to the Enviorment Variables under PATH: (C:\Users\Administrator\AppData\Roaming\npm\node_modules\angular-cli\bin\ng) , with no success also. What am i doing wrong? 51 Answers 51 I solved this problem in accordance with the figure: run in cmd npm … Read more