Skip to content

hide/delete underline input #6623

@PatrickCharriere

Description

@PatrickCharriere

Bug

Property 'underlineRef' does not exist on type 'MdInputDirective'

However, underlineRef property exists if we log this MdInputDirective:

angularerror

Expected behavior

@ViewChild('input') input: MdInputDirective;

ngOnInit(): void {
  this.input.underlineRef.nativeElement.className = null;  // Removes the input underline 
}

What is the current behavior?

Compilation error

What are the steps to reproduce?

Link of a discussion on the issue:
https://stackoverflow.com/questions/45556972/how-to-hide-delete-underline-input-angular-material

Is there anything else we should know?

Workaround
@ViewChild('input') input: MdInputDirective;

ngOnInit(): void {
  this.input['underlineRef'].nativeElement.className = null;  // Remove the input underline 
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions