Extracting CSS into JS with Angular 11 (deprecated extractCss)

One of the changes for Angular CLI 11.0 is deprecation of extractCss configuration property. Getting error “extractCss is deprecated” comes because it has default value as true now. extractCss can be safely removed from angular.json or during the upgrade schematics should do it for you. This means that we don’t use styles.js anymore during the … Read more

Using Angular-CLI build to copy a file / directory

For those wanting to copy files outside the src folder: In example below I am copying all files from myfolder to the root dist folder. In the angular-cli.json file (3rd line): “assets”: [ { “glob”: “**/*”, “input”: “./assets/”, “output”: “./assets/” }, { “glob”: “favicon.ico”, “input”: “./”, “output”: “./” }, { “glob”: “**/*”, “input”: “../myfolder”, “output”: … Read more

Angular 15 CLI does not create environments folder when creating an angular project via ng new

See Angular – Configure Environment Specific Defaults EDIT:- As predicted, GitHub Issue After the release of Angular CLI 15.1, a generation schematic will be available to add environment files for all existing build configurations within a project. Example usage: ng g environments To manually create: If you want to recreate environments, follow these steps: Create … Read more

angular-cli how to add global styles?

As of the beta.14 release of the CLI (which uses Angular 2.0 final), a global stylesheet can be linked inside angular-cli.json under the “styles” key. This is a reference to a file relative to the src/ directory, which is style.css by default. Leveraging this method you could: Copy the global styles into src/styles.css Use CSS … Read more

ng generate component in subdirectory

Because there are 2 modules (app.module.ts, shared.module.ts) found the CLI does not know which module to declare your component in. To get around this you have to tell the CLI which module you wish to declare your component in with the module option ng generate component pages/about –module=app.module // or ng generate component pages/about –module=shared.module

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