gpt4 book ai didi

Angular 示意图 : trustedSubscriber. _addParentTeardownLogic

转载 作者:太空狗 更新时间:2023-10-29 19:32:29 25 4
gpt4 key购买 nike

我正在尝试构建 Angular Schematics 来帮助我和我的团队快速创建 NgRx 操作。这是原理图功能,大部分是从各种教程中复制过来的:

export default (options: CCSchematicsAction): Rule => {
return (tree: Tree, _context: SchematicContext) => {
const modulePath = options.modulePath.replace(/-?module$/, ""); // "shared/application-tools"
const moduleFolder = normalize("src/app/" + modulePath); // "src/app/shared/application-tools"
const modulePathComponents = modulePath.split("/"); // ["shared", "application-tools"]
const moduleIdentifier = modulePathComponents
.map(part => classify(part))
.join(".")
+ ".Action"; // "Shared.ApplicationTools.Action"

const action = options.name.replace(/-?action$/, "");
const path = normalize(moduleFolder + "/action/" + action) + "/";

const templateSource = apply(url("./files"), [
template({
action: action,
moduleIdentifier: moduleIdentifier
}),
move(path)
]);

return chain([
mergeWith(templateSource)
])(tree, _context);
};
}

我调用原理图

schematics cc-generate:action load-stuff-action --modulePath shared/ui

并获得以下内容,我什至无法在网上找到任何信息:

TypeError: trustedSubscriber._addParentTeardownLogic is not a function
at MergeMapSubscriber.Subscriber [as constructor] (/Users/voss/Development/cc/cc-schematics/node_modules/rxjs/internal/Subscriber.js:45:43)
at MergeMapSubscriber.OuterSubscriber [as constructor] (/Users/voss/Development/cc/cc-schematics/node_modules/rxjs/internal/OuterSubscriber.js:20:42)
at new MergeMapSubscriber (/Users/voss/Development/cc/cc-schematics/node_modules/rxjs/internal/operators/mergeMap.js:48:28)
at MergeMapOperator.call (/Users/voss/Development/cc/cc-schematics/node_modules/rxjs/internal/operators/mergeMap.js:39:33)
at Observable.subscribe (/Users/voss/Development/cc/cc-schematics/node_modules/rxjs/internal/Observable.js:24:22)
at DefaultIfEmptyOperator.call (/usr/local/lib/node_modules/@angular-devkit/schematics-cli/node_modules/rxjs/internal/operators/defaultIfEmpty.js:24:23)
at Observable.subscribe (/Users/voss/Development/cc/cc-schematics/node_modules/rxjs/internal/Observable.js:24:22)
at TakeLastOperator.call (/usr/local/lib/node_modules/@angular-devkit/schematics-cli/node_modules/rxjs/internal/operators/takeLast.js:35:23)
at Observable.subscribe (/Users/voss/Development/cc/cc-schematics/node_modules/rxjs/internal/Observable.js:24:22)
at DoOperator.call (/usr/local/lib/node_modules/@angular-devkit/schematics-cli/node_modules/rxjs/internal/operators/tap.js:29:23)

编辑:

当我删除所有内容并只返回一个空链时,错误仍然存​​在。

export default (_options: CCSchematicsAction): Rule => {
return (tree: Tree, _context: SchematicContext) => {
return chain([noop()])(tree, _context);
};
}

那么 chain 函数有什么问题呢?

最佳答案

没关系,问题是 @angular-devkit/schematics-cli 的不同版本..

关于 Angular 示意图 : trustedSubscriber. _addParentTeardownLogic,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52147174/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com