Skip to content

Materials 3, trying to get started with Angular 17 #5351

Discussion options

You must be logged in to vote

The custom element class MdOutlinedTextField cannot be registered in the @NgModule's components array since it isn't an Angular component.

Instead, you should import the component registration as a side effect and enable its use with schemas: [CUSTOM_ELEMENTS_SCHEMA] in your @NgModule or @Component metadata.

// Import custom element registrations. These are called side-effect imports.
// You can import them all at once, or in each individual Angular component that
// uses them (better for tree-shaking and code splitting).
import '@material/web/textfield/outlined-text-field';

import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';

@NgModule({
  schemas: [CUSTOM_ELEMENTS_SCHEMA]
})

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@dreamstar-enterprises
Comment options

@dreamstar-enterprises
Comment options

@asyncLiz
Comment options

@dreamstar-enterprises
Comment options

Answer selected by asyncLiz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants