SystemJs is case sensitive (by design). If you use different path name in your project files like this:
main.ts
import { categoryService } from './categoryService';
category-component.ts
import { categoryService } from './categoryservice';
then System js will make double imports
This way angular2 will find other instance of service object in providers Map keys.
Despite the fact that key exists in Map object.
has
method of Map will return false
. That's why you're receiving an error.
See also more information about key equality within Map object at this page https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Map#Key_equality
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…