{"action":"created","issue":{"url":"https://api.github.com/repos/dart-lang/angular/issues/992","repository_url":"https://api.github.com/repos/dart-lang/angular","labels_url":"https://api.github.com/repos/dart-lang/angular/issues/992/labels{/name}","comments_url":"https://api.github.com/repos/dart-lang/angular/issues/992/comments","events_url":"https://api.github.com/repos/dart-lang/angular/issues/992/events","html_url":"https://github.com/dart-lang/angular/pull/992","id":301663933,"number":992,"title":"doc(Core): Start a guide on best DI practices.","user":{"login":"matanlurey","id":168174,"avatar_url":"https://avatars2.githubusercontent.com/u/168174?v=4","gravatar_id":"","url":"https://api.github.com/users/matanlurey","html_url":"https://github.com/matanlurey","followers_url":"https://api.github.com/users/matanlurey/followers","following_url":"https://api.github.com/users/matanlurey/following{/other_user}","gists_url":"https://api.github.com/users/matanlurey/gists{/gist_id}","starred_url":"https://api.github.com/users/matanlurey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matanlurey/subscriptions","organizations_url":"https://api.github.com/users/matanlurey/orgs","repos_url":"https://api.github.com/users/matanlurey/repos","events_url":"https://api.github.com/users/matanlurey/events{/privacy}","received_events_url":"https://api.github.com/users/matanlurey/received_events","type":"User","site_admin":false},"labels":[{"id":420145781,"url":"https://api.github.com/repos/dart-lang/angular/labels/cla:%20yes","name":"cla: yes","color":"0e8a16","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":18,"created_at":"2018-03-02T06:11:35Z","updated_at":"2018-04-15T19:46:07Z","closed_at":"2018-03-03T00:18:10Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/dart-lang/angular/pulls/992","html_url":"https://github.com/dart-lang/angular/pull/992","diff_url":"https://github.com/dart-lang/angular/pull/992.diff","patch_url":"https://github.com/dart-lang/angular/pull/992.patch"},"body":"WIP: Not yet ready to merge, but feedback welcome.\r\n\r\n## Items I'd still like to cover\r\n\r\n### Misc\r\n\r\n* [x] Rename as effective versus guide.\r\n\r\n~~* Writing code that is reliant on `initReflector()` side-effects.~~\r\n\r\n### Providers\r\n\r\n* [x] Note that using types implicitly as a provider is not a best practice.\r\n\r\n### Tokens\r\n\r\n* [x] Note how to use OpaqueToken, typed providers.\r\n* [x] Use `MulitToken` over `multi: true`\r\n\r\n### Components\r\n\r\n* [x] What _should_ dependency injection be used/not used for (inputs, outputs?).\r\n\r\n> Waiting on feedback from @jonahwilliams.\r\n\r\n### Testing\r\n\r\n~~* Writing component tests without using `provide(...)`~~\r\n\r\n> Not sure this is worth it yet, since not all test beds support this."},"comment":{"url":"https://api.github.com/repos/dart-lang/angular/issues/comments/381432792","html_url":"https://github.com/dart-lang/angular/pull/992#issuecomment-381432792","issue_url":"https://api.github.com/repos/dart-lang/angular/issues/992","id":381432792,"user":{"login":"chalin","id":4140793,"avatar_url":"https://avatars1.githubusercontent.com/u/4140793?v=4","gravatar_id":"","url":"https://api.github.com/users/chalin","html_url":"https://github.com/chalin","followers_url":"https://api.github.com/users/chalin/followers","following_url":"https://api.github.com/users/chalin/following{/other_user}","gists_url":"https://api.github.com/users/chalin/gists{/gist_id}","starred_url":"https://api.github.com/users/chalin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chalin/subscriptions","organizations_url":"https://api.github.com/users/chalin/orgs","repos_url":"https://api.github.com/users/chalin/repos","events_url":"https://api.github.com/users/chalin/events{/privacy}","received_events_url":"https://api.github.com/users/chalin/received_events","type":"User","site_admin":false},"created_at":"2018-04-15T19:46:07Z","updated_at":"2018-04-15T19:46:07Z","author_association":"COLLABORATOR","body":"@cedx, how about trying this simpler factory function:\r\n\r\n```dart\r\nProvider locationStrategyFactory() => new ClassProvider(LocationStrategy,\r\n    useClass: config['locationStrategy'] == 'hash'\r\n        ? HashLocationStrategy\r\n        : PathLocationStrategy);\r\n```\r\n\r\nIf that doesn't work, print the value of `config['locationStrategy']` and make sure that it is actually `'hash'`.\r\n\r\n(Also, you might want to move any further questions to Stackoverflow.)\r\n\r\n"}}
{"actor":{"display_login":"chalin"}}