Skip to content

addDeclarationToModule says "UPDATE" but the update does not occur #26

@raul1991

Description

@raul1991

I have written the following code by peeking into the angular/schematics/component/index.js code

const declarationChanges = addDeclarationToModule(sourceFile, newLocal, `List${strings.classify(_options.name)}Component`, `./components/general-configuration/${dasherize(_options.name)}/list/list-${dasherize(_options.name)}.component`);
    const declarationRecorder = tree.beginUpdate(newLocal);
    for (const change of declarationChanges) {
        if (change instanceof InsertChange) {
            _context.logger.info(change.toAdd);
            declarationRecorder.insertLeft(change.pos, change.toAdd);
        }
    }
    tree.commitUpdate(declarationRecorder);

I get the following output
UPDATE src/app/app.module.ts (1959 bytes)
but the file still has no changes in it. Any idea what's going wrong here ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions