2
カスタムコンポーネントを作成する際に、以下のエラーが発生します。シンボル値を静的に解決する際にエラーが発生しました。関数 'CreateCustomComponent'を呼び出すと、関数呼び出しはサポートされません。
シンボル値を静的に解決する際にエラーが発生しました。関数 'CreateCustomComponent'を呼び出すと、関数呼び出しはサポートされません d。関数またはラムダを、エクスポートされた関数への参照で置き換えて、シンボルcus_inputを解決することを検討してください。
マイファイルは以下のようになります。いずれか私のコードの下に私に答えを与えてください?
動的コンポーネントを作成mは私はmが動的コンポーネントを作成し、これらのコンポーネントの入力を使用するためのjQueryプラグインを設定している意味し、なぜ「app.modeule.ts」に以下のように同様に ここimport { MY_INP_Component} from './customcomponent/core';
import { AppComponent } from './app.component';
@NgModule({
imports: [BrowserModule, FormsModule, HttpModule, RouterModule.forRoot(rootRouterConfig, { useHash: true })],
declarations: [AppComponent,
MY_INP_Component
],
bootstrap: [AppComponent],
})
export class AppModule { }
インポート
export class MyComponent {
constructor() {
console.log("Component created");
}
}
export function CreateCustomComponent(componentArgs: {
selector: string,
inputs: Array<string>,
template: string
}): Type<any> {
let comp = Component(componentArgs);
return comp.Class({
extends: MyComponent,
constructor: []
});
}
export let cus_input :any = CreateCustomComponent({selector: 'cus-inp',inputs : ["myinput"],template : '<input [value]="myinput" />'})
export const MY_INP_Component: any = [cus_input];
jqueryプラグインで出力します。
ありがとうございます。この解決策は私の問題を解決するのに役立ちます –
...また、私にとってはうまくいかないようです – Tyguy7