Ich erhalte die folgende Fehlermeldung hinzufügen, wenn ich @angular/material
und @angular/cdk
:Wie Winkelmaterial in Angular ~ 4.3.3
http://localhost:3000/@angular/cdk/observe-content (404) Not found error
systemjs.config.js
map: {
...
// Angular Material
'@angular/material': 'npm:@angular/material/bundles/material.umd.js',
// CDK individual packages
'@angular/cdk/platform': 'npm:@angular/cdk/bundles/cdk-platform.umd.js',
'@angular/cdk/a11y': 'npm:@angular/cdk/bundles/cdk-a11y.umd.js',
}
materialmodule.ts
import { NgModule } from '@angular/core';
import { MdButtonModule, MdCheckboxModule,MdButton } from '@angular/material';
@NgModule({
imports: [
MdButtonModule,
MdButton
],
exports: [
MdButtonModule,
MdButton
]
})
export class CustomMaterialModule { }
app.component.ts
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { AppComponent } from './app.component';
import {CustomMaterialModule} from './materialmodule/material.module';
@NgModule({
imports: [
BrowserModule,
BrowserAnimationsModule,
CustomMaterialModule
],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
Was von meinem Code fehlt, die den Fehler verursacht, wie oben angegeben?
Haben Sie versucht, "@ angular/cdk/observe-content" hinzuzufügen: "npm: @ eckig/cdk/bundles/cdk-observe-content.umd.js" in Ihrer systemjs-Konfiguration? – PierreDuc
Warum haben Sie ein Duplikat von 'MdButtonModule' in Ihrem Modul? – Edric