I'm trying to use <mat-slide-toggle>Click me!</mat-slide-toggle>
inside a component which already has MatSlideToggleModule
imported, but I'm still getting the message that it's not a known element.
Angular version: 8.0.1
HTML Page (slide-page.html)
<div class="grid-slide-toggle-material">
<mat-slide-toggle>Click me!</mat-slide-toggle>
</div>
Module (slide-page.module.ts)
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { CommonModule } from '@angular/common';
import { MaterialModule } from 'projects/authenticator/src/shared/modules/material.module';
import { BasicModule } from 'src/app/shared/modules/basic/basic.module';
import { MatButtonToggleModule, MatButtonToggleGroup } from '@angular/material';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import { ReactiveFormsModule, FormsModule } from '@angular/forms';
@NgModule({
declarations: [],
imports: [
MaterialModule,
ReactiveFormsModule,
CommonModule,
FormsModule,
MatButtonToggleModule,
MatSlideToggleModule
]
})
export class SlidePageModule { }
How is it possible that the html is not being recognized even after the imports in the item's module?
admin
. No idea how it got there. Fixing the declarations solved the issue – Ponytail