Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding prefix or suffix causes error #3882

Closed
its-dibo opened this issue Mar 22, 2024 · 1 comment
Closed

adding prefix or suffix causes error #3882

its-dibo opened this issue Mar 22, 2024 · 1 comment
Labels

Comments

@its-dibo
Copy link

adding prefix or suffix causes error: templateRef.createEmbeddedViewImpl

{
 key: 'example',
 props:{
   prefix: 'mail'
  }
}
main.ts:5 ERROR TypeError: templateRef.createEmbeddedViewImpl is not a function
    at ViewContainerRef2.createEmbeddedView (core.mjs:15530:37)
    at _NgTemplateOutlet.ngOnChanges (common.mjs:4406:40)
    at _NgTemplateOutlet.rememberChangeHistoryAndInvokeOnChangesHook (core.mjs:5892:14)
    at callHookInternal (core.mjs:6138:14)
    at callHook (core.mjs:6169:9)
    at callHooks (core.mjs:6120:17)
    at executeInitAndCheckHooks (core.mjs:6070:9)
    at refreshView (core.mjs:12152:21)
    at detectChangesInView (core.mjs:12361:9)
    at detectChangesInViewIfAttached (core.mjs:12324:5)

I saw some examples, but all of them uses custom wrappers that set props.prefix value

versions

 "@angular/core": "^17.0.0",
 "@ngx-formly/core": "^6.2.2",
 "@ngx-formly/material": "^6.2.2",
@its-dibo its-dibo added the bug label Mar 22, 2024
@aitboudad
Copy link
Member

Prefix / Suffix in Material expect templateRef instance that why we provided an example of how to properly pass templateRef to the field using custom wrapper.

There is also another way which doesn't require custom wrapper that you can check in the following link: https://formly.dev/docs/examples/other/material-formfield-hint-align

@aitboudad aitboudad added question and removed bug labels Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants