Add a declaration to an NgModule
The NgModule class declaration
Name of the component/directive/pipe to declare
Optionaloptions: { unique?: boolean }Optional configuration
Add an import to a standalone component
The component class declaration
Name of the import (e.g., 'CommonModule')
Optionaloptions: { unique?: boolean }Optional configuration
Add an import to an NgModule
The NgModule class declaration
Name of the module to import (e.g., 'CommonModule')
Optionaloptions: { unique?: boolean }Optional configuration
Add a provider to a standalone component
The component class declaration
Provider to add (e.g., 'MyService')
Optionaloptions: { unique?: boolean }Optional configuration
Apply all changes to the file system This delegates to the ts-morph Project's save method
Apply changes synchronously
Find the NgModule that declares a component
Get a specific component by file path
Get all Angular components matching a pattern
Optionalpattern: stringGet a specific module by file path
Get all Angular modules matching a pattern
Optionalpattern: stringGet the underlying ts-morph Project
Remove a component from an NgModule's declarations This is a custom implementation since ng-morph doesn't provide this directly
Uses ts-morph to manipulate the @NgModule decorator's declarations array.
The NgModule class declaration
Name of the component to remove
True if successfully removed, false otherwise
Wrapper around ng-morph for Angular-specific AST operations on an existing ts-morph
Project, so they work with the ts-morph based infrastructure.