<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/angular-schematics-deep-dive-part-2-fz36iqdnt" -->

---
title: Angular Schematics Deep Dive — Part 2 | daily.dev
description: Part 2 of a six-part series walks through building a custom Angular schematic invoked via ng generate, producing components with an organisation-specific...
canonical: https://daily.dev/posts/angular-schematics-deep-dive-part-2-fz36iqdnt
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Angular Schematics Deep Dive — Part 2 | daily.dev
og:description: Part 2 of a six-part series walks through building a custom Angular schematic invoked via ng generate, producing components with an organisation-specific...
og:url: https://daily.dev/posts/angular-schematics-deep-dive-part-2-fz36iqdnt
og:image: https://api.daily.dev/og/posts/FZ36Iqdnt.png
og:image:alt: Angular Schematics Deep Dive — Part 2
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Angular Schematics Deep Dive — Part 2

**[Angular.love](https://daily.dev/sources/angularlove)** · 16 min read · 0 upvotes · 0 comments

## Summary

Part 2 of a six-part series walks through building a custom Angular schematic invoked via ng generate, producing components with an organisation-specific selector prefix baked in. It covers setting up the schematics workspace, wiring collection.json and schema.json, writing the factory function with apply/applyTemplates/move, the strings utility functions (dasherize, classify, camelize, etc.), the __name@dasherize__ filename template syntax, and building file templates. It closes with a broader discussion of enterprise use cases: consistent scaffolding, domain-specific patterns, ng update for breaking/non-breaking library migrations, platform-wide operational changes via chained Rules, and a comparison table contrasting ng generate versus ng update.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://angular.love/angular-schematics-deep-dive-part-2-ng-generate>

## Questions this post answers

### How do I create a custom Angular schematic that generates components with a custom selector prefix using ng generate?

Set up a schematics workspace with @angular-devkit/schematics-cli, register the schematic in collection.json pointing to a factory function, and define options like name and prefix in schema.json. The factory function uses apply(url('./files'), [applyTemplates({...strings, name, prefix}), move(targetPath)]) merged into the Tree, with template files named using __name@dasherize__.component.ts.template syntax so selectors like acme-my-button are generated automatically instead of the default app-my-button.

_daily.dev surfaces deeper schematics guides for teams standardizing Angular component scaffolding._

### What is the difference between using ng generate and ng update to deliver an Angular schematic?

ng generate is manually triggered by a developer with no version awareness and is registered in collection.json, suited for on-demand scaffolding and opt-in operational tasks. ng update runs automatically during a package version upgrade, is registered in migrations.json, has full version awareness so it only runs migrations applicable to the version delta, and the CLI guarantees each migration runs exactly once, making it the right choice for library API migrations tied to a version bump.

_Developers choosing between generate-time and update-time automation can track Angular tooling patterns on daily.dev._

### What does the __name@dasherize__ syntax mean in an Angular schematic template filename?

It is a filename template expression where the part before the @ is the variable (like name) and the part after is the transform function (like dasherize) applied to that variable's value. Angular's schematics DevKit resolves this before writing files, so __name@dasherize__.component.ts.template with name 'UserProfileCard' becomes user-profile-card.component.ts, since file paths cannot contain the < > % characters used in regular template syntax.

_daily.dev helps developers keep up with Angular DevKit template conventions while building internal tooling._

## Similar posts on daily.dev

- [Angular 00: Introduction to Angular 22](https://daily.dev/posts/angular-00-introduction-to-angular-22-xtjsurcuc) · Medium · 3 upvotes · 0 comments
- [This Completely Changed My Angular Development Workflow](https://daily.dev/posts/this-completely-changed-my-angular-development-workflow-zdumxsopl) · ITNEXT · 0 upvotes · 0 comments
- [Angular Micro-frontend Application Using Native Federation](https://daily.dev/posts/angular-micro-frontend-application-using-native-federation-sugrbomif) · Telerik · 0 upvotes · 0 comments
- [Ng-News 26/02: Frameworks in 2026, Competition among Frameworks, Angular Inside](https://daily.dev/posts/ng-news-26-02-frameworks-in-2026-competition-among-frameworks-angular-inside-5nmtx91eg) · This is Angular · 0 upvotes · 0 comments

---

Tags: [#typescript](https://daily.dev/tags/typescript), [#angular](https://daily.dev/tags/angular)

[View this post on daily.dev](https://daily.dev/posts/angular-schematics-deep-dive-part-2-fz36iqdnt)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Angular Schematics Deep Dive — Part 2","url":"https://daily.dev/posts/angular-schematics-deep-dive-part-2-fz36iqdnt","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/angular-schematics-deep-dive-part-2-fz36iqdnt"},"datePublished":"2026-09-20T07:44:36.080Z","dateModified":"2026-09-20T07:50:31.192Z","description":"Part 2 of a six-part series walks through building a custom Angular schematic invoked via ng generate, producing components with an organisation-specific...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/2091bfc9408bffadcd1ab27343dc8372?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/2091bfc9408bffadcd1ab27343dc8372?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Angular.love","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Angular.love","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/b638946cd9c74bf6a260e4e6a40212d7","url":"https://daily.dev/sources/angularlove"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/angular-schematics-deep-dive-part-2-fz36iqdnt","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"typescript,angular","timeRequired":"PT16M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Angular.love","item":"https://daily.dev/sources/angularlove"},{"@type":"ListItem","position":3,"name":"Angular Schematics Deep Dive — Part 2"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/angular-schematics-deep-dive-part-2-fz36iqdnt#faq","mainEntity":[{"@type":"Question","name":"How do I create a custom Angular schematic that generates components with a custom selector prefix using ng generate?","acceptedAnswer":{"@type":"Answer","text":"Set up a schematics workspace with @angular-devkit/schematics-cli, register the schematic in collection.json pointing to a factory function, and define options like name and prefix in schema.json. The factory function uses apply(url('./files'), [applyTemplates({...strings, name, prefix}), move(targetPath)]) merged into the Tree, with template files named using __name@dasherize__.component.ts.template syntax so selectors like acme-my-button are generated automatically instead of the default app-my-button. daily.dev surfaces deeper schematics guides for teams standardizing Angular component scaffolding."}},{"@type":"Question","name":"What is the difference between using ng generate and ng update to deliver an Angular schematic?","acceptedAnswer":{"@type":"Answer","text":"ng generate is manually triggered by a developer with no version awareness and is registered in collection.json, suited for on-demand scaffolding and opt-in operational tasks. ng update runs automatically during a package version upgrade, is registered in migrations.json, has full version awareness so it only runs migrations applicable to the version delta, and the CLI guarantees each migration runs exactly once, making it the right choice for library API migrations tied to a version bump. Developers choosing between generate-time and update-time automation can track Angular tooling patterns on daily.dev."}},{"@type":"Question","name":"What does the __name@dasherize__ syntax mean in an Angular schematic template filename?","acceptedAnswer":{"@type":"Answer","text":"It is a filename template expression where the part before the @ is the variable (like name) and the part after is the transform function (like dasherize) applied to that variable's value. Angular's schematics DevKit resolves this before writing files, so __name@dasherize__.component.ts.template with name 'UserProfileCard' becomes user-profile-card.component.ts, since file paths cannot contain the \u003c \u003e % characters used in regular template syntax. daily.dev helps developers keep up with Angular DevKit template conventions while building internal tooling."}}]}
```

