Questions tagged [angular-schematics]

Schematics is a workflow tool for the modern web; it can apply transforms to your project, such as create a new component, or updating your code to fix breaking changes in a dependency. Or maybe you want to add a new configuration option or framework to an existing project. Angular schematics are part of angular-cli and are used to generate components, modules, pipes, etc.

179 questions
0
votes
1 answer

Angular 2+ custom webpack path issue

I want to use @ngneat/tailwind that's it a schematics for change an angular project into a one with a custom webpack configuration. After added that all my scss import paths about fonts or other partial scss aren't resolved, and i receive the…
Alessandro_Russo
  • 1,799
  • 21
  • 34
0
votes
1 answer

How to make Angular Schematics run "ng add" command?

A part of my Schematics needs to install Angular Material. However, Angular Material is usually installed via the command: ng add @angular/material How do I make my Schematics to run the command ng add @angular/material? I would expect it run that…
timthekoder
  • 415
  • 5
  • 16
0
votes
0 answers

Angular schematics for library: building schematics gives error in angular 10

As per Angular doc on schematics for library https://angular.io/guide/schematics-for-libraries I tried running script to build schematics with npm run build https://angular.io/guide/schematics-for-libraries#building-your-schematics "scripts": { …
0
votes
1 answer

How to run Angular CLI commands from code

is there a way to run ng g component from code - something like on button click from UI need to run this command and component should be created. Purpose : I have created Angular custom schematic which is used as dependency in angular application.…
0
votes
1 answer

Angular - Custom schematics - Create a whole project with a library

everything is in the title ! But here's more details. I'm currently developing a schematics which will create a complete angular project including a library. I'm using externalSchematic to do it: const rule: Rule = chain([ …
SebClz
  • 33
  • 1
  • 5
0
votes
2 answers

Could not find a declaration file for module '@schematics/angular/utility/project'

I want to use the buildDefaultPath method usually available in '@schematics/angular/utility/project' to write an Angular schematics. I installed the package with npm i @schematics/angular and tried to import it like this: import { buildDefaultPath }…
Touré Holder
  • 2,768
  • 2
  • 22
  • 20
0
votes
1 answer

Enable angular.json schema for WebStorm 2020.1.2

For some reason angular.json (@angular/cli@9.1.0) schema is not loaded by WebStorm 2020.1.2. This makes customizing angular.json much harder. This was working in older WebStorm version. I tried adding the angular.json schema manually, still no…
Hivaga
  • 3,738
  • 4
  • 23
  • 36
0
votes
1 answer

How to call `ng add` of library in custom `ng new`

I have a workspace including two angular libraries with ng add schematics and a schematics project with a custom ng new schematic. I'd like to call the ng add schematics of the libraries from my ng new schematic, so I don't have to maintain their…
pfeileon
  • 290
  • 1
  • 17
0
votes
0 answers

Angular Schematics Prompt type "confirmation"

Requirement I want to use prompt type "confirmation" in schematics and based on the "Yes"/ "No" I want to hide the next question. As shown in the below schema.json file there is one confirmation and one list of multiselect values. I want to hide…
0
votes
1 answer

nrwl/nx schematics create angular app and configure angular json

I'm working in a nrwl/nx monorepo. My applications are having a custom configuration in angular.json. For example the output path were customized. Now i want to write my own schematic, which will configure my project. My problem is, I don't know…
Lukas
  • 155
  • 1
  • 2
  • 7
0
votes
2 answers

Upgrading NG-Zorro from V8 to V9 gives: "Class extends value undefined is not a constructor or null"

After running ng update ng-zorro-antd we get: [error] TypeError: Class extends value undefined is not a constructor or null at Object. (C:\Users\\Desktop\Work\
Ionel Lupu
  • 2,695
  • 6
  • 29
  • 53
0
votes
1 answer

Npm accidentally deletes packages installed via 'ng add'

tested on node 13.10.1 I'm installing some Angular Libraries+schematics (written by me) via ng add command. The libraries are added to the package.json but not to the package-lock.json. When I try to serve my project, I got an error message for the…
Nemus
  • 1,322
  • 2
  • 23
  • 47
0
votes
1 answer

How to execute a angular schematics from Oclif

I'm writting a CLI using Oclif, and i try to exec a Custom Schematics that i build but if i launch separated using "ng add" command, the schematics ask correctly. If i launch schematic from Oclif, it don't ask anything. Examples: Works: In terminal:…
0
votes
0 answers

Run Angular schematics programmaticaly (wihout the CLI)

The question is pretty short: is this possible to run a schematic without the CLI, meaning within my code? Like so: import { Component} from '@angular/core'; @Component({ selector: 'app-name', templateUrl: './name.component.html', styleUrls:…
KevinTale
  • 1,658
  • 3
  • 25
  • 47
0
votes
1 answer

Angular Schematics: How to reach filesToCreate record set coming from previous operation in a chain?

I've made a chained schematics and in the first part I generate a module using: externalSchematic('@schematics/angular', 'module', moduleOptions). In the second part/element of the chain I call a schematic I've written and I want to edit one of the…
Bogac
  • 3,596
  • 6
  • 35
  • 58