Angular Material's documentation says:
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
@NgModule ({
imports: [
MatSlideToggleModule,
]
})
class AppModule {}
But Angular 17 doesn't create app.module file by default. Is there any way to do that without app.module?
import dependencies into the component instead of app.modules, add attribute standalone:true , like the code below:
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
@Component({
standalone:true,
imports: [
MatSlideToggleModule,
],
selector: 'your-component',
templateUrl: './your.component.html',
styleUrls: ['./your.component.scss']
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With