# Getting Started with Angular Schematics

**URL:** <https://devforum.okta.com/t/getting-started-with-angular-schematics/16993>\
**Category:** Developer Blog Comments\
**Created:** [February 6, 2019, 7:29pm UTC](https://devforum.okta.com/t/getting-started-with-angular-schematics/16993 "2019-02-06T19:29:12Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [February 6, 2019, 7:29pm UTC](https://devforum.okta.com/t/getting-started-with-angular-schematics/16993/1 "2019-02-06T19:29:12Z")

</div>

[Getting Started with Angular Schematics](https://developer.okta.com/blog/2019/02/13/angular-schematics)

Learn what Schematics are and how to create your first one.

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [February 20, 2019, 12:29am UTC](https://devforum.okta.com/t/getting-started-with-angular-schematics/16993/2 "2019-02-20T00:29:45Z")

</div>

**Matthew Ridderikhoff**

I’m on windows 10 and x-prompt works when i run my schematic in it’s project (.:my-schematic) but not when I npm link it (ng g my-schematic:my-schematic). Same goes for ng add @oktadev/schematics.

I DO see the prompts when running the command in Command Prompt instead of Git Bash.  
Any idea why this isn’t working for me?

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [February 20, 2019, 12:50am UTC](https://devforum.okta.com/t/getting-started-with-angular-schematics/16993/3 "2019-02-20T00:50:25Z")

</div>

**Matt Raible**

What error do you see? Is it just that the prompt doesn’t happen?

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [February 20, 2019, 12:51am UTC](https://devforum.okta.com/t/getting-started-with-angular-schematics/16993/4 "2019-02-20T00:51:42Z")

</div>

**Matthew Ridderikhoff**

The prompt just don’t appear. If it’s a required field that is supposed to be prompted and it has no default value, i get “schematic input does not validate against the schema”.

Oddly enough the prompts DO work in the Command Prompt. Seems like it’s an issue with Git Bash…

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [September 2, 2019, 10:39pm UTC](https://devforum.okta.com/t/getting-started-with-angular-schematics/16993/5 "2019-09-02T22:39:01Z")

</div>

**Mike Ritchie**

Is there any way to do this for other verbs too? I tried the same naming for “ng generate” but I have to write the command as “ng generate myPackage:ng-generate”

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [September 5, 2019, 2:50pm UTC](https://devforum.okta.com/t/getting-started-with-angular-schematics/16993/6 "2019-09-05T14:50:00Z")

</div>

**Matt Raible**

I don’t think there’s anyway to override `ng generate`. You’ll have to use the full name of your schematic when running with `ng generate` or `schematics`. You can make it so you can run `ng add $yourSchematic`.

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [April 26, 2020, 9:00pm UTC](https://devforum.okta.com/t/getting-started-with-angular-schematics/16993/7 "2020-04-26T21:00:03Z")

</div>

**rahul bawa**

I learnt so much from this blog post. Thanks a lot.

I want to understand how the modify operation will be done while adding the new component (generated via our schematics) into the existing module.ts file ?

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [April 26, 2020, 11:28pm UTC](https://devforum.okta.com/t/getting-started-with-angular-schematics/16993/8 "2020-04-26T23:28:55Z")

</div>

**Matt Raible**

You can use [schematics-utilities](https://www.npmjs.com/package/schematics-utilities "https://www.npmjs.com/package/schematics-utilities") to modify an existing `module.ts` file, specifically in [angular/ast-utils](https://nitayneeman.github.io/schematics-utilities/modules/_angular_ast_utils_.html "https://nitayneeman.github.io/schematics-utilities/modules/\_angular\_ast\_utils\_.html"). For instance, [there’s what it looks like to add imports to the main module](https://github.com/oktadeveloper/schematics/blob/master/src/add-auth/index.ts#L211 "https://github.com/oktadeveloper/schematics/blob/master/src/add-auth/index.ts#L211").

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [April 27, 2020, 12:58pm UTC](https://devforum.okta.com/t/getting-started-with-angular-schematics/16993/9 "2020-04-27T12:58:20Z")

</div>

**rahul bawa**

Thanks, this is what I was looking for. So you learnt all this looking the angular schematics code base or is there any reference blog posts that you use ? I actually about it via your and Tomas Trajan’s talk in Angular zurich on youtube.

Lastly, If I face some more issues, should I just keep writing them here or can I ping you somewhere else as well ?

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [April 27, 2020, 3:05pm UTC](https://devforum.okta.com/t/getting-started-with-angular-schematics/16993/10 "2020-04-27T15:05:52Z")

</div>

**Matt Raible**

I learned some of it looking through Angular CLI’s schematics and the rest from the blog posts I referenced at the bottom of this post. If you face issues writing your own schematic, you’ll likely get more help from posting your question to Stack Overflow and tagging it with “angular-schematics”. I watch that tag so I can try to help if I know the answer.

---

<div class="post-metadata">

**Author:** ![oktadev-blog](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/oktadev-blog/32/3422_2.png) [@oktadev-blog](https://devforum.okta.com/u/oktadev-blog)\
**Post date:** [July 22, 2021, 11:01am UTC](https://devforum.okta.com/t/getting-started-with-angular-schematics/16993/11 "2021-07-22T11:01:38Z")

</div>

**Omar AlJaber**

Big thank for the video, but suppose I want to add extra folder in the files folder and I want to render it conditionally according to param I am sending is it possible
