angular cli exclude files/directory for `ng test –code-coverage`

With the latest CLI, inside angular.json “test”: { “builder”: “@angular-devkit/build-angular:karma”, “options”: { “main”: “src/test.ts”, “polyfills”: “src/polyfills.ts”, “tsConfig”: “src/tsconfig.spec.json”, “karmaConfig”: “./karma.conf.js”, “codeCoverageExclude”: [“src/testing/**/*”],

Avoiding relative paths in Angular CLI

Per this comment, you can add your application source via paths in tsconfig.json: { “compilerOptions”: { …, “baseUrl”: “.”, “paths”: { …, “@app/*”: [“app/*”], “@components/*”: [“components/*”] } } } Then you can import absolutely from app/ or components/ instead of relative to the current file: import {TextInputConfiguration} from “@components/configurations”; Note: baseUrl must be specified if … Read more

Implementing a plugin architecture / plugin system / pluggable framework in Angular 2, 4, 5, 6

Update For Angular 11 I strongly recommend you to take a look at implementation with Webpack 5 Module Federation 🎉 https://github.com/alexzuza/angular-plugin-architecture-with-module-federation Previos version 🛠️ Github demo angular-plugin-architecture Maybe Ivy can change something but for the time being I use the solution that uses Angular CLI Custom Builder and meets the following requirements: AOT avoid duplicate … Read more

How to iterate using ngFor loop Map containing key as string and values as map iteration

For Angular 6.1+ , you can use default pipe keyvalue ( Do review and upvote also ) : <ul> <li *ngFor=”let recipient of map | keyvalue”> {{recipient.key}} –> {{recipient.value}} </li> </ul> WORKING DEMO For the previous version : One simple solution to this is convert map to array : Array.from Component Side : map = … 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