183 questions
0
votes
0
answers
16
views
Implementation of custom Angular schematics inside a project
I have an Angular 19 project and would like to add some schematics to it. Since these will depend on project components, such as src/shared/*, I don't see a reason to create a separate project as an ...
1
vote
1
answer
116
views
Internal Error while using angular compiler to parse html
I am creating a angular shcematics project to propose suggestions to my angular project. I am trying to use the built in angular compiler to parse the code because libraries such as parse5 and ...
1
vote
0
answers
38
views
Ngrx action group: automatic way to rewrite old Actions
I have over 800 Actions in my project written in the old form:
export const GetAction = createAction(
'[BOOK] GET',
props<{
filter: BookFilterModel,
}>(),
);
export const ...
1
vote
0
answers
41
views
ng-update schematic - object property migration
I'm currently working on an implementation for an ng-update schematic for our internal design system. We have components and interfaces that are renamed between 2 versions of our package. The ...
1
vote
0
answers
75
views
Can Nx or Angular Schematics support global path aliases in project.json for all keys requiring relative paths, such as $schema?
In our current workflow, in Nx Monorepo, we are developing VSCode extensions that automate the creation and configuration of new (e.g. Angular) apps based on templates located in various ...
2
votes
1
answer
195
views
Jest tests using @angular-devkit/schematics are throwing errors for the encoded data was not valid for encoding utf-8
On three different applications Angular are failing all test that use @angular-devkit/schematics. Two of the applications were passing fine on Angular 17.2.0 but failed after upgrading to 17.3.7. The ...
0
votes
1
answer
154
views
error NG8002: Can't bind to 'owlDateTimeTrigger' since it isn't a known property of 'input'
HI i need to add owlDateTimeTrigger in angular 16 microfrontent but it show error. please check the below screenshot.
Code:
<ng-template #childtemplateSheduleTime let-data>
<input [(ngModel)]...
0
votes
2
answers
4k
views
error NG2012: Component imports must be standalone components, directives, pipes, or must be NgModules
If we add some dependency in angular standalone component and app.module then show this error:
error NG2012: Component imports must be standalone components, directives, pipes, or must be NgModules
1
vote
1
answer
119
views
addImportToModule returns empty array of changes
I'm trying to use angular schematics to add imports to NgModule. I'm using Angular 16.2.5. Here's the code of the logic:
import { addImportToModule, insertImport} from '@schematics/angular/utility/ast-...
0
votes
1
answer
585
views
Package "single-spa-angular" was found but does not support schematics
I am trying to convert existing angular app to single spa microfrontend but I am getting the following error
"Package "single-spa-angular" was found but does not support schematics.&...
4
votes
1
answer
4k
views
How to perform standalone migration in multi-workspace (with Angular schematics)
In a multi-project Angular repo, I could not manage to get the @angular/core:standalone-schematics to work (this allows an automatic conversion of module-based components to standalone components).
...
1
vote
0
answers
140
views
In angular, does ng generate keep path info?
This question is more about how deep inside ng generate command works.
I am using Visual Studio Code to develop an Angular project.
I am generating components and services using the terminal section ...
1
vote
2
answers
1k
views
How to use Angular Schematics not published but in project direclty
I want to create an Angular Schematics to create some components and make it easier to develop my application. The problem is that i don't want to publish it, i want to use it "as it is" in ...
1
vote
0
answers
31
views
Is there a way to inherit Schema of custom schematic?
Using Angular Schematics, I would like to build a schematic which inherits the schema from a "Base" schematic (which is private and hidden, so it cannot be executed from CLI).
So when I run:
...
1
vote
0
answers
22
views
How to print help form Schematics?
Is there a built-in method for printing formatted CLI help message using Angular Schematics. I'm thinking of something something like Yargs would produce, for example.
schematics @my-schematic --help
...
1
vote
0
answers
188
views
Problem with Angular Schematics Tree persisting in local file system before executing command
I'm using @angular-devkit/schematics to create a schematic for my NodeJS projects. The schematic is really simple. It just needs to add husky to the devDependencies of the project along with the ...
0
votes
1
answer
239
views
Angular Material Component schematics
Whenever I run this command ng generate @angular/material:navigation dashboard the terminal shows this
The 'path' option in '__\Desktop\machine test\employee\node_modules@angular\material\schematics\...
0
votes
1
answer
398
views
Angular material : Navigation schematics doesn't work
I want to create angular material navigation schematics.
when i run
ng generate @angular/material:navigation command it gives error.
The 'path' option in 'C:\Users\Pradeepa saravanan\Documents\TS\...
0
votes
1
answer
118
views
Error: Schematic "rest" cannot resolve the factory
function looks like this:
I am using first time nestjs for generators, it seems like i have some issue in collection.json
export function application(options: any) {
// eslint-disable-next-line @...
0
votes
1
answer
111
views
What is the replacement for askConfirmation in Angular 14 Schematics?
How can I accomplish this in angular 14?
It seems askConfirmation is no longer exported from '@angular/cli/utilities/prompt'.
https://github.com/angular/angular-cli/blob/...
0
votes
1
answer
700
views
Angular Material : Material Navigation does not work
I want to create a navigation schematics with this command :
ng generate @angular/material:navigation <component-name>
But it gives me an error as below :
The 'path' option in '...\node_modules@...
3
votes
1
answer
528
views
How to add a dev dependency with angular schematics extending from ng-new
I need to add dev dependencies when i use ng-new external schematic
I tried many things but right now the most successful one is the this:
context.addTask(
new NodePackageInstallTask({
...
0
votes
1
answer
648
views
Angular schematics error when using external schematic ng-new, version required
Im trying to create a schematic that uses the angular ng-new as first call and my other schematic that adds a prettier file to the new project. When i execute the command i get the error
Data path &...
0
votes
1
answer
1k
views
Error when generating new angular app in Nx workspace
We're getting the following error when trying to generate an Angular app in an Nx workspace following an upgrade from Angular/Nx 12->14:
SchematicsException [Error]: Project "name-of-app" ...
15
votes
4
answers
36k
views
Angular 14: Error: A collection and schematic is required during execution
I am trying to learn angular. I installed the lastest version and created an app called test using ng new test command.
Then I opened the app in visual studio code. In the terminal I entered the ...
0
votes
1
answer
164
views
How to delete / skip directory using Angular schematics?
I have some files in my schematics template which should be generated only when a certain input options is present. e.g: db==true
Is there a way to skip these directories / files?
One solution is to ...
0
votes
2
answers
193
views
Angular Schematics - Create Interface/Model from JSON Response
As I am trying to automate my Development process, I would like to create a Ts/Angular Interface based on a JSON response.
Let‘s say that I am getting a response which looks like this
{"name"...
0
votes
1
answer
626
views
"Unknown argument" when creating a model with angular-crud
I'm trying to setup the package 'angular-crud' in my Angular 14 project.
Followed the README instructions at https://www.npmjs.com/package/angular-crud, including creating a folder under src/app with ...
1
vote
1
answer
502
views
Unable to navigate inside a Tree in angular devkit schematics
I want to create a CLI based on schematics to improve projects creation for my job and I want to scaffold an Angular Application AND an Angular Library in one command. So I tried to use ...
0
votes
1
answer
214
views
Angular schematics - how to set a constant name
I'm trying to create schematics to create an Angular service with a constant name that should not be changed by the user.
I've removed all of the references to the 'name' variable but when I try to ...
2
votes
0
answers
276
views
Add to bootstrapApplication in Angular 14 schematic
With Angular 14 and standalone components, the app.module.ts can go away and instead something like this goes in main.ts instead:
bootstrapApplication(AppComponent, {
providers: [
...
1
vote
1
answer
10k
views
How to force Cypress Schematic to install a specific version of Cypress?
In an Angular project, ng add @cypress/schematic installs the latest version of Cypress by default. With the many breaking changes in Cypress 10 and a lack of documentation for implementing Cucumber ...
3
votes
0
answers
523
views
Angular Schematic - Change execution scope or directory after calling the ng-new schematic
I have an angular schematic where I create a new project, then call ng-add to add a package to that new project.
It looks like this:
export function createProject(options) {
return () => {
...
3
votes
1
answer
6k
views
Error: Schematic input does not validate against the Schema: {...}, Data path "" must NOT have additional properties(...)
I am creating custom schematics, which I want to use to generate component files in a separate Angular project. For this purpose I am using conditional templates relying on optional parameters ...
6
votes
0
answers
326
views
Is there a way to use Nrwl Nx's AST utils for Angular in Nx >13
I wrote a few generators that were working until I did a recent migration. I was importing and using Nrwl AST utils using import paths like:
import { addImportToModule } from '@nrwl/angular/src/utils/...
1
vote
3
answers
10k
views
Angular schematics exception: "NOT SUPPORTED: keyword "id", use "$id" for schema ID"
I have a custom schematic that won't apply to a new project... I also looked at this question but I couldn't make it work...
My main workspace runs with this configuration:
Angular CLI: 13.2.3
Node: ...
0
votes
1
answer
1k
views
Updating from Angular11 to 13 generates error Data path "" must NOT have additional properties(styleext)
I have checked out the following prescriptions for this problem and they did not resolve my issue. I upgraded from angular 11 to 13 following the procedure on the Angular official website which went ...
0
votes
0
answers
395
views
How to commit changes to Git in Angular Schematic
I would like my Angular Schematic for ng add to automatically commit its changes to Git. Adding a Rule to commit the changes to Git after all my other Rules doesn't work properly because it executes ...
0
votes
1
answer
620
views
How to show 'Angualar Schematic...' entry in project popup menu?
I have an angular project where the Angular menu items are missing.
In the settings it seems to be configured correctly:
But in the pop-up menu (from the project-view) the entries are missing:
Note: ...
1
vote
0
answers
685
views
Upgrading to Angular 13 with NX monorepo broke custom ng schematics
I'm extending @nrwl/schematics to create a custom Angular component schematic. After running nx migrate latest, npm i, then nx migrate --run-migrations=migrations.json, I get the following error when ...
1
vote
1
answer
430
views
What is packageGroup in ng-update object?
I am doing analysis around ng-update command in angular to run custom logic after ng-update.
I came across an ng-update object's property packageGroup of which I did not find detailed explanation.
...
7
votes
1
answer
9k
views
How to run e2e Angular tests with Playwright?
I would like run end-to-end (e2e) browser tests for my Angular application using Playwright. However, as of November 2021, I have not been able to find an Angular Schematic for Playwright.
For example,...
0
votes
1
answer
220
views
How to change variable at module with angular schematics?
Just like addImportToModule or addProviderToModul,my module file look like this:
const EXAMPLES = [
ButtonIconExampleComponent,
ButtonTextExampleComponent,
ButtonDashedExampleComponent
]
@...
1
vote
2
answers
1k
views
Output text at the very end of custom Nx workspace generator
Is it possible to output/log text at the very end the workspace generator output?
I would like to notify the user of the next steps he/she should do, but my logs are kind of hidden above all the ...
3
votes
1
answer
596
views
How to remove empty folders or delete directories in a tree using Angular Schematics?
I am trying to delete a folder with files using Tree.delete. Unfortunately there's an error if you're trying to delete a directory. So, I created a function that recursively removes the files using ...
0
votes
0
answers
382
views
Angular schematics caching somewhere
I feel like my custom schematics is cached somewhere and is running an old version. Before the weekend I had published my schematic to npm, and had installed globally. I made some updates to my index....
3
votes
2
answers
951
views
Angular Schematics Skip "implements OnInit"
I've found plenty about how to setup my schematic file to skip certain things (like the spec file) when creating a component using ng generate but what I can't find anywhere is how to not include the ...
0
votes
1
answer
790
views
trying to add @ionic/angular to existing angular 12 app fails
When trying to run:
ng add @ionic/angular
to this existing repo: https://github.com/skyleguy/angular-capacitor-project-base
results in:
ℹ Using package manager: npm
✔ Found compatible package version:...
0
votes
1
answer
264
views
Issue publishing and installing standalone schematic package to Angular project
My goal is to publish a custom Angular schematic package to my company's private npm registry for other devs to leverage. Here's what I've accomplished so far:
Created separate schematic project ...
4
votes
1
answer
3k
views
Extending NX generate component
In my Monorepo, there are two types of components that i am using.
Is a standard component for applications, and nx g c foo works fine here.
Is a library component for a library. Here, I exclusively ...