{"action":"created","issue":{"url":"https://api.github.com/repos/salemdar/angular2-cookie/issues/12","repository_url":"https://api.github.com/repos/salemdar/angular2-cookie","labels_url":"https://api.github.com/repos/salemdar/angular2-cookie/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/salemdar/angular2-cookie/issues/12/comments","events_url":"https://api.github.com/repos/salemdar/angular2-cookie/issues/12/events","html_url":"https://github.com/salemdar/angular2-cookie/issues/12","id":168533799,"number":12,"title":"Injecting CookieService inside another service","user":{"login":"ritz078","id":5389035,"avatar_url":"https://avatars.githubusercontent.com/u/5389035?v=3","gravatar_id":"","url":"https://api.github.com/users/ritz078","html_url":"https://github.com/ritz078","followers_url":"https://api.github.com/users/ritz078/followers","following_url":"https://api.github.com/users/ritz078/following{/other_user}","gists_url":"https://api.github.com/users/ritz078/gists{/gist_id}","starred_url":"https://api.github.com/users/ritz078/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ritz078/subscriptions","organizations_url":"https://api.github.com/users/ritz078/orgs","repos_url":"https://api.github.com/users/ritz078/repos","events_url":"https://api.github.com/users/ritz078/events{/privacy}","received_events_url":"https://api.github.com/users/ritz078/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-07-31T19:27:05Z","updated_at":"2016-08-03T20:59:58Z","closed_at":null,"body":"Can't get this to work .\r\n\r\n```ts\r\nimport {Injectable} from '@angular/core';\r\n\r\nimport {CookieService} from 'angular2-cookie/core';\r\n\r\n@Injectable()\r\nexport class SelectedCityService {\r\n  constructor(private _cookie: CookieService) {\r\n  }\r\n\r\n  get selectedCity(): Object {\r\n    return this._cookie.getObject('selectedCity');\r\n  }\r\n\r\n  set selectedCity(selectedCity: Object) {\r\n    this._cookie.putObject('selectedCity', selectedCity);\r\n  }\r\n}\r\n```\r\n\r\nI get a DI error. \r\n`No provider for CookieService`"},"comment":{"url":"https://api.github.com/repos/salemdar/angular2-cookie/issues/comments/237371791","html_url":"https://github.com/salemdar/angular2-cookie/issues/12#issuecomment-237371791","issue_url":"https://api.github.com/repos/salemdar/angular2-cookie/issues/12","id":237371791,"user":{"login":"yazeedb","id":6687119,"avatar_url":"https://avatars.githubusercontent.com/u/6687119?v=3","gravatar_id":"","url":"https://api.github.com/users/yazeedb","html_url":"https://github.com/yazeedb","followers_url":"https://api.github.com/users/yazeedb/followers","following_url":"https://api.github.com/users/yazeedb/following{/other_user}","gists_url":"https://api.github.com/users/yazeedb/gists{/gist_id}","starred_url":"https://api.github.com/users/yazeedb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yazeedb/subscriptions","organizations_url":"https://api.github.com/users/yazeedb/orgs","repos_url":"https://api.github.com/users/yazeedb/repos","events_url":"https://api.github.com/users/yazeedb/events{/privacy}","received_events_url":"https://api.github.com/users/yazeedb/received_events","type":"User","site_admin":false},"created_at":"2016-08-03T20:59:58Z","updated_at":"2016-08-03T20:59:58Z","body":"That could be it, @ritz078 \r\n`No provider for service` usually means you haven't added that service to your `providers` array. This is because in Angular 2, you can't just inject a service into another class's constructor, it has to be declared in either that class's `providers` array, or a parent class/component's.\r\n\r\nHope that helps"}}
{"actor":{"display_login":"yazeedb"}}