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
![enter image description here](https://i.stack.imgur.com/6N3xr.png)
This way angular2 will find other instance of service object in providers Map keys.
![enter image description here](https://i.stack.imgur.com/eOiQ6.png)
Despite the fact that key exists in Map object.
![enter image description here](https://i.stack.imgur.com/kAaHm.png)
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
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…