#material angular input doesnt have any style
17 messages · Page 1 of 1 (latest)
<p>
<mat-form-field appearance="fill">
<mat-label>Fill form field</mat-label>
<input matInput placeholder="Placeholder">
<mat-icon matSuffix>sentiment_very_satisfied</mat-icon>
<mat-hint>Hint</mat-hint>
</mat-form-field>
</p>
<p>
<mat-form-field appearance="outline">
<mat-label>Outline form field</mat-label>
<input matInput placeholder="Placeholder">
<mat-icon matSuffix>sentiment_very_satisfied</mat-icon>
<mat-hint>Hint</mat-hint>
</mat-form-field>
</p>
Follow angular material guide for adding prebuilt themes.
i have included all in my module
It has nothing to do with modules.
How did you install the package?
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { AppBarComponent } from './app-bar/app-bar.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
//Material import
import {MatToolbarModule} from '@angular/material/toolbar';
import {MatIconModule} from '@angular/material/icon';
import {MatButtonModule} from '@angular/material/button';
import { HomepageComponent } from './homepage/homepage.component';
import { Routes } from '@angular/router';
import { AssistenzaComponent } from './assistenza/assistenza.component';
import {MatCard, MatCardModule} from '@angular/material/card';
import {ClipboardModule} from '@angular/cdk/clipboard';
import {MatSnackBarModule} from '@angular/material/snack-bar';
import { MessageComponent } from './message/message.component';
import {MatFormFieldModule} from '@angular/material/form-field';
import { ReactiveFormsModule } from '@angular/forms';
@NgModule({
declarations: [
AppComponent,
AppBarComponent,
HomepageComponent,
AssistenzaComponent,
MessageComponent,
],
imports: [
BrowserModule,
AppRoutingModule,
BrowserAnimationsModule,
MatToolbarModule,
MatIconModule,
MatButtonModule,
MatCardModule,
MatSnackBarModule,
MatFormFieldModule,
ReactiveFormsModule,
MatFormFieldModule,
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
i have installed material with npm
So, not with ng add?
That's why you should have been following the official docs.
As an alternative you can manually add the prebuilt theme scss to angular.json or to your style.scss.
Otherwise, re-install with ng add, it will not hram anyone.
https://material.angular.io/guide/getting-started
ng add @angular/material, yes i have used this not npm
all other component is well styled
but input not have any style
Which theme are you using?