SAP Spartacus delivery mode页面Cannot find control with的错误消息

时间:2022-07-28
本文章向大家介绍SAP Spartacus delivery mode页面Cannot find control with的错误消息,主要内容包括其使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

渲染对应的字段:

/**
 * @license
 * Copyright Google LLC All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
/**
 * Advances to an element for later binding instructions.
 *
 * Used in conjunction with instructions like {@link property} to act on elements with specified
 * indices, for example those created with {@link element} or {@link elementStart}.
 *
 * ```ts
 * (rf: RenderFlags, ctx: any) => {
 *   if (rf & 1) {
 *     text(0, 'Hello');
 *     text(1, 'Goodbye')
 *     element(2, 'div');
 *   }
 *   if (rf & 2) {
 *     advance(2); // Advance twice to the <div>.
 *     property('title', 'test');
 *   }
 *  }
 * ```
 * @param delta Number of elements to advance forwards by.
 *
 * @codeGenApi
 */
function ɵɵadvance(delta) {
    ngDevMode && assertGreaterThan(delta, 0, 'Can only advance forward');
    selectIndexInternal(getTView(), getLView(), getSelectedIndex() + delta, getCheckNoChangesMode());
}

执行init和检查hook:

执行hook:

this.formDirective.addControl(this): this指向FormContrlName:

找不到deliveryModeIdJerry这个控件:

所以最后报错:

在这里将deliveryModeId重命名成deliveryModeIdJerry即可。

纠正之后问题解决:

要获取更多Jerry的原创文章,请关注公众号"汪子熙":