How to set environment via `ng serve` in Angular 6

You need to use the new configuration option (this works for ng build and ng serve as well) ng serve –configuration=local or ng serve -c local If you look at your angular.json file, you’ll see that you have finer control over settings for each configuration (aot, optimizer, environment files,…) “configurations”: { “production”: { “optimization”: true, … Read more

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

To explain the actual problem that tslint is pointing out, a quote from the JavaScript documentation of the for…in statement: The loop will iterate over all enumerable properties of the object itself and those the object inherits from its constructor’s prototype (properties closer to the object in the prototype chain override prototypes’ properties). So, basically … Read more

How to add bootstrap to an angular-cli project

IMPORTANT UPDATE: ng2-bootstrap is now replaced by ngx-bootstrap ngx-bootstrap supports both Angular 3 and 4. Update : 1.0.0-beta.11-webpack or above versions First of all check your angular-cli version with the following command in the terminal: ng -v If your angular-cli version is greater than 1.0.0-beta.11-webpack, then you should follow these steps: Install ngx-bootstrap and bootstrap: … Read more

How to add font-awesome to Angular 2 + CLI project

After Angular 2.0 final release, the structure of the Angular2 CLI project has been changed — you don’t need any vendor files, no system.js — only webpack. So you do: npm install font-awesome –save In the angular-cli.json file locate the styles[] array and add font-awesome references directory here, like below: “apps”: [ { “root”: “src”, … Read more

ng is not recognized as an internal or external command

I solved this problem in accordance with the figure: run in cmd npm install -g @angular/cli and then ( open in Windows 10) Control Panel\All Control Panel Items\System or accordance with the figure step 1: step 2 : step3: step4: step5: add missing ng path Here is new environment variable that you need add: C:\Users\PK\AppData\Roaming\npm\node_modules\@angular\cli\bin … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)