Components: Template parse errors: Can't bind to 'cdkObserveContentDisabled'

Created on 9 Jan 2019  路  3Comments  路  Source: angular/components

I'm having a simple example of trying to use Material controls in a new project (specifically Datepicker) and I'm running into the following issue at runtime:

Uncaught Error: Template parse errors:
Can't bind to 'cdkObserveContentDisabled' since it isn't a known property of 'label'. ("m-field-label-wrapper"><label class="mat-form-field-label" (cdkObserveContent)="updateOutlineGap()" [ERROR ->][cdkObserveContentDisabled]="appearance != 'outline'" [id]="_labelId" [attr.for]="_control.id" [attr."): ng:///MaterialModule/MatFormField.html@0:930
    at syntaxError (compiler.js:2427)
    at TemplateParser.push../node_modules/@angular/compiler/fesm5/compiler.js.TemplateParser.parse (compiler.js:20311)
    at 
...

Searching Google for the error didn't help. I think I have everything set up correctly.

P4 needs clarification

Most helpful comment

Apparently it had to do with the way I imported the Material modules and components. The docs are incomplete or unclear - they're missing information about the fact that one has to import the MatInputModule, MatFormFieldModule and also export those if you are using the Material module option.

All 3 comments

Can you double-check that you've got similar versions of @angular/material and @angular/cdk?

Apparently it had to do with the way I imported the Material modules and components. The docs are incomplete or unclear - they're missing information about the fact that one has to import the MatInputModule, MatFormFieldModule and also export those if you are using the Material module option.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings