Angular 错误TS2416:属性'_注册处';类型为';MockMatchMedia';
之后,我通过Angular 错误TS2416:属性'_注册处';类型为';MockMatchMedia';,angular,angular7,Angular,Angular7,之后,我通过ng serve获得此错误: ERROR in node_modules/@angular/flex-layout/core/typings/match-media/mock/mock-match-media.d.ts(25,15): error TS2416: Property '_registry' in type 'MockMatchMedia' is not assignable to the same property in base type 'MatchMedia'.
ng serve
获得此错误:
ERROR in node_modules/@angular/flex-layout/core/typings/match-media/mock/mock-match-media.d.ts(25,15): error TS2416: Property '_registry' in type 'MockMatchMedia' is not assignable to the same property in base type 'MatchMedia'.
Type 'Map<string, MockMediaQueryList>' is not assignable to type 'Map<string, MediaQueryList>'.
Type 'MockMediaQueryList' is not assignable to type 'MediaQueryList'.
Property 'onchange' is missing in type 'MockMediaQueryList'.
node_modules/@angular/flex-layout/core/typings/match-media/mock/mock-match-media.d.ts(63,22): error TS2420: Class 'MockMediaQueryList' incorrectly implements interface 'MediaQueryList'.
Property 'onchange' is missing in type 'MockMediaQueryList'.
node_modules/@angular/flex-layout/core/typings/match-media/mock/mock-match-media.d.ts(80,27): error TS2304: Cannot find name 'MediaQueryListListener'.
node_modules/@angular/flex-layout/core/typings/match-media/mock/mock-match-media.d.ts(82,23): error TS2304: Cannot find name 'MediaQueryListListener'.
node_modules/@angular/flex-layout/core/typings/match-media/server-match-media.d.ts(11,22): error TS2420: Class 'ServerMediaQueryList' incorrectly implements interface 'MediaQueryList'.
Property 'onchange' is missing in type 'ServerMediaQueryList'.
node_modules/@angular/flex-layout/core/typings/match-media/server-match-media.d.ts(28,27): error TS2304: Cannot find name 'MediaQueryListListener'.
node_modules/@angular/flex-layout/core/typings/match-media/server-match-media.d.ts(30,23): error TS2304: Cannot find name 'MediaQueryListListener'.
node_modules/@angular/flex-layout/core/typings/match-media/server-match-media.d.ts(42,15): error TS2416: Property '_registry' in type 'ServerMatchMedia' is not assignable to the same property in base type 'MatchMedia'.
Type 'Map<string, ServerMediaQueryList>' is not assignable to type 'Map<string, MediaQueryList>'.
Type 'ServerMediaQueryList' is not assignable to type 'MediaQueryList'.
Property 'onchange' is missing in type 'ServerMediaQueryList'.
node_modules/@angular/flex-layout/core/typings/match-media/server-match-media.d.ts(54,15): error TS2416: Property '_buildMQL' in type 'ServerMatchMedia' is not assignable to the same property in base type 'MatchMedia'.
Type '(query: string) => ServerMediaQueryList' is not assignable to type '(query: string) => MediaQueryList'.
Type 'ServerMediaQueryList' is not assignable to type 'MediaQueryList'.
node_modules/@angular/flex layout/core/typings/match media/mock/mock match media.d.ts(25,15)中出现错误:错误TS2416:类型“MockMatchMedia”中的属性“\u registry”不能分配给基类型“MatchMedia”中的相同属性。
类型“Map”不可分配给类型“Map”。
类型“MockMediaQueryList”不可分配给类型“MediaQueryList”。
类型“MockMediaQueryList”中缺少属性“onchange”。
node_modules/@angular/flex layout/core/typings/match media/mock/mock match media.d.ts(63,22):错误TS2420:类“MockMediaQueryList”不正确地实现接口“MediaQueryList”。
类型“MockMediaQueryList”中缺少属性“onchange”。
node_modules/@angular/flex layout/core/typings/match media/mock/mock match media.d.ts(80,27):错误TS2304:找不到名称“MediaQueryListener”。
node_modules/@angular/flex layout/core/typings/match media/mock/mock match media.d.ts(82,23):错误TS2304:找不到名称“mediaQueryListener”。
node_modules/@angular/flex layout/core/typings/match media/server match media.d.ts(11,22):错误TS2420:Class'ServerMediaQueryList'不正确地实现了接口'MediaQueryList'。
类型“ServerMediaQueryList”中缺少属性“onchange”。
node_modules/@angular/flex layout/core/typings/match media/server match media.d.ts(28,27):错误TS2304:找不到名称“mediaQueryListener”。
node_modules/@angular/flex layout/core/typings/match media/server match media.d.ts(30,23):错误TS2304:找不到名称“MediaQueryListener”。
node_modules/@angular/flex layout/core/typings/match media/server match media.d.ts(42,15):错误TS2416:类型“ServerMatchMedia”中的属性“_registry”不能分配给基类型“MatchMedia”中的相同属性。
类型“Map”不可分配给类型“Map”。
类型“ServerMediaQueryList”不可分配给类型“MediaQueryList”。
类型“ServerMediaQueryList”中缺少属性“onchange”。
node_modules/@angular/flex layout/core/typings/match media/server match media.d.ts(54,15):错误TS2416:类型“ServerMatchMedia”中的属性“_buildMQL”不能分配给基类型“MatchMedia”中的相同属性。
类型'(查询:字符串)=>ServerMediaQueryList'不可分配给类型'(查询:字符串)=>MediaQueryList'。
类型“ServerMediaQueryList”不可分配给类型“MediaQueryList”。
更新至@angular/flex layout 7.0.0-beta.19
或更高版本:
npm install @angular/flex-layout@^7.0.0-beta.19
无需报告;这是