これは繰り返し質問ですが、ここに挙げた解決策のどれも私を助けませんでした。私は、コンソールで次のエラーを取得しています:Could not find Angular Material core theme. Most Material components may not work as expected. For more info refer to the theming guide: https://material.angular.io/guide/theming
角度のある素材2コアのテーマが見つかりません
私はすでにやっていること:
-
角度-cli.json
Suggested Here
- で追加されたスタイルのキーは、CSSへの実際のパスをしようとしました
- Suggested Here
その他いくつか。私はタブを紛失したようだ。
ここで私が興味をそそられるのは、ここから見てスタイルが読み込まれているということです。
だからクラスであり、その材料のチェックのために:mat-theme-loaded-marker
。
しかし、私はまだ読み込むことができないようです。同じエラー。
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { RouterModule, Routes } from '@angular/router';
import 'hammerjs';
import { LoginComponent } from './components/login/app';
import { CookieService } from 'ngx-cookie-service';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { MaterialModule } from '@angular/material';
const appRoutes: Routes = [
{path: 'login', component: LoginComponent},
{ path: '**', component: LoginComponent }
];
@NgModule({
declarations: [
LoginComponent
],
imports: [
FormsModule,
HttpModule,
BrowserModule,
BrowserAnimationsModule,
RouterModule.forRoot(
appRoutes,
{ enableTracing: true } // <-- debugging purposes only
),
MaterialModule
],
providers: [ CookieService],
bootstrap: [ LoginComponent ]
})
export class AppModule { }
PSは:次のように
マイAppModuleがある私は、材料設計と角度2を開発し、角度4.
Btw:あなたはもはや 'MaterialModule'をやりません。代わりに、 'MdButtonModule'のような必要なコンポーネントのモジュールなどを追加するだけです。ここをクリックしてください:[はじめに](https://material.angular.io/guide/getting-started)。 – pzaenger
'stylesheets import'のシーケンスは何ですか?あなたの投稿にCSSを追加してください – Aravind
@pzaengerええ、私は最初、同じエラーを試みました。したがって、これに固執します。 –