ng2-materialとangular2を使用しようとしています。ng2-material TypeError:all_2.Media.hasMediaは関数ではありません
EXCEPTION: TypeError: all_2.Media.hasMedia is not a function in [hasMedia('gt-sm') ? 'side' : 'over' in [email protected]:32]
EXCEPTION: Error: Uncaught (in promise): EXCEPTION: TypeError: all_2.Media.hasMedia is not a function in [hasMedia('gt-sm') ? 'side' : 'over' in [email protected]:32] ORIGINAL EXCEPTION: TypeError: all_2.Media.hasMedia is not a function ORIGINAL STACKTRACE: TypeError: all_2.Media.hasMedia is not a function at AppComponent.hasMedia (http://localhost:3000/app/app.component.js:67:40) at AbstractChangeDetector.ChangeDetector_AppComponent_0.detectChangesInRecordsInternal (viewFactory_AppComponent:114:31) at AbstractChangeDetector.detectChangesInRecords (http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:9609:14) at AbstractChangeDetector.runDetectChanges (http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:9592:12) at AbstractChangeDetector._detectChangesInViewChildren (http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:9671:14) at AbstractChangeDetector.runDetectChanges (http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:9596:12) at AbstractChangeDetector.detectChanges (http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:9581:12) at ChangeDetectorRef_.detectChanges (http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:5252:16) at http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:12954:27 at Array.forEach (native) ERROR CONTEXT: [object Object]
そしてそこにすべてがall_2.Media.hasMedia
に関連する多くのより多くのエラーがあるおそらくこれはそれを
を引き起こしている可能性がありますコードは次のとおりです。Sidenavコンポーネントをしようとしている間、私はこれらのエラーを取得しています
hasMedia(breakSize: string): boolean {
return Media.hasMedia(breakSize);
}
私はinstructions on ng2-material siteに従っており、すでにng2材料の加工をしていますg。
どうすれば解決できますか?
私は私のコンポーネントでhasMediaを()が定義されています:NG2-材料ウェブサイト上で、今説明したように
:修正がクラスにメディアを挿入し、クラスのローカルバージョンを使用することですメソッドでconsole.logを使用してチェックしているので呼び出されています。今私の関数は、ライブラリのMediaコンポーネントからhadMedia()も呼び出します。私の質問の最初の行で説明したデモサイトをチェックしてください。 – Shri