2

I made input component and render component in formly.

This is simple thing: the app component is render the render-component and render-component is render the input component.

But the input component is not rendered. why how make it works?

I followed according to formly repeat example.

Codesandbox

@Component({
  selector: "formly-input",
  template: ` <input /> `
})
export class InputTypeComponent extends FieldType {}

Render component:

@Component({
  selector: "formly-render",
  template: `
    this should be render:
    <formly-field [field]="{ type: 'input' }"></formly-field>
  `
})
export class RenderTypeComponent extends FieldType {}

Both register in the root component:

  FormlyModule.forRoot({
      types: [
        { name: "input", component: InputTypeComponent },
        { name: "formly-render", component: RenderTypeComponent }
      ]
    })

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.