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
1
vote
1 answer

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 output generated by the tree updates. export default…
sjbuysse
  • 3,872
  • 7
  • 25
  • 37
1
vote
1 answer

Custom Angular Schematics extremly slow

I am working on a custom package that will override default Angular Schematics, by providing a custom template for spec files. So running ng generate component should create a component as in default schematics, but the spec file should be…
Maciej Wojcik
  • 2,115
  • 2
  • 28
  • 47
1
vote
0 answers

How to use Angular Formly Schematics to generate real forms

Is it there an angular schematic to generate HTML forms? I heard of Formly as being a schematics but I don't need to use tag/component. How to get the HTML code generated so one can edit them. PS: found this good option but it's based on material…
Bellash
  • 7,560
  • 6
  • 53
  • 86
1
vote
0 answers

How to create Custom schematic to create new angular project and some files

i need to create a custom schematic to create new angular project and following add some components to newly created application . I hope someone has solution for this problem not able to find one yet.
1
vote
0 answers

Conditional "X-Prompt" in Angular Scehmatics

Requirement : To display conditional prompts, based on the previous selection ( "Analytics", in this case ). Problem : For any selection, it is still displaying the prompt to add Google Analytics's Tracking Id even if i select AppDynamics or…
yanky_cranky
  • 1,303
  • 1
  • 11
  • 16
1
vote
1 answer

how do I test ng-add schematics

I decided to add an ng-add schematic to my library, since there are additional setup steps when installing it past running npm/yarn install. This way, users will be able to run ng add @myorg/mylib and the schematics will run I am having difficulty…
f.khantsis
  • 3,256
  • 5
  • 50
  • 67
1
vote
1 answer

Angular schematics cannot delete files

I have a custom schematic in which I want to add some files to the standard angular application schematic. I do this by running a mergeWith to add some of my own custom files. A bit later due to some setting, I wish to delete one of my own files.…
1
vote
1 answer

Schematics - Manage template files copy error

I'm managing to copy some files from the schematics files directory to the main project target folder: function addTplFiles(path: string): Source { // copy templates return apply(url('./files'), [ move(path as string) ]); } export…
Nemus
  • 1,322
  • 2
  • 23
  • 47
1
vote
1 answer

How to access Angular project folder from a custom Angular schematic?

I am developing a custom Angular Schematic. This schematic has to access a folder inside the Angular project that will make use of the schematic. (The folder contains config files needed to generate my .ts files). The schematic will prompt the user…
dacil
  • 13
  • 4
1
vote
1 answer

Angular Schematic Library Tests

When setting up schematics in a library you end up with a structure like so: library -schematics --update ---index.spec.ts -src --test.ts How would I setup the index.spec.ts to run with the library tests when the nested test.ts searches for tests…
Anthony
  • 7,638
  • 3
  • 38
  • 71
1
vote
1 answer

@ngrx/schematics fail when generate anctions and reducers

I just installed @ngrx/schematics to enable me to generate reducers and actions with angular CLI in an existing app in what I am using @ngrx/store. I use the command yar add @ngrx/schematics and then I configured to use instead of angular schematics…
xzegga
  • 3,051
  • 3
  • 25
  • 45
1
vote
0 answers

Error when I try install @schematics/update@0.803.2

When I tried to npm i @schematics/update@0.803.2 I got: npm ERR! notarget No matching version found for @schematics/update@0.803.2 npm ERR! notarget In most cases you or one of your dependencies are requesting npm ERR! notarget a package version…
1
vote
1 answer

How do I loop through an array in a template?

I am using Angular's schematics in a project. I have an array of numbers: const numbers = [1, 2, 3, 4, 5] And I want to print them out in an HTML template. I am passing the array in the following way: export function schematics(_options: Schema):…
Leandro
  • 1,244
  • 16
  • 28
1
vote
0 answers

How do I create a "chained" schematic?

I don't know the correct term for what I need, so I will try to explain it as clear as possible. In CLIs like sequelize-cli you can run either sequelize db:create or sequelize db:drop. I want to create two schematics whose first part is a command in…
Leandro
  • 1,244
  • 16
  • 28
1
vote
2 answers

Use schematics to mutate HTML content of an angular project

I have a simple schematic running that proves how schematics work as described in https://angular.io/guide/schematics-for-libraries My next step is to do something relevent to my project using the schematic - What I want is to add a directive to all…
user2789284
  • 751
  • 1
  • 11
  • 28