我在Angular应用程序中遇到此问题,在其他文件夹中这是正常工作而不是它向我显示此消息。
Type 'Map<string, Person>' is not assignable to type 'Map<string, Person>'. Two different types with this name exist, but they are unrelated.
这是代码
persons: Map<string, Person>;
store.select('rodex').subscribe(rodex => {
this.persons = rodex.persons;
});
答案 0 :(得分:0)
更改声明的变量
来自
persons: Map<string, Person>;
到
persons = Map<string, Person>();
并像这样导入地图
import { Map } from 'immutable';