{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/6466","labels_url":"https://api.github.com/repos/angular/angular/issues/6466/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/6466/comments","events_url":"https://api.github.com/repos/angular/angular/issues/6466/events","html_url":"https://github.com/angular/angular/issues/6466","id":126487715,"number":6466,"title":"Codegen DI: Implement the new API shimmed ontop of the current API","user":{"login":"tbosch","id":690815,"avatar_url":"https://avatars.githubusercontent.com/u/690815?v=3","gravatar_id":"","url":"https://api.github.com/users/tbosch","html_url":"https://github.com/tbosch","followers_url":"https://api.github.com/users/tbosch/followers","following_url":"https://api.github.com/users/tbosch/following{/other_user}","gists_url":"https://api.github.com/users/tbosch/gists{/gist_id}","starred_url":"https://api.github.com/users/tbosch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbosch/subscriptions","organizations_url":"https://api.github.com/users/tbosch/orgs","repos_url":"https://api.github.com/users/tbosch/repos","events_url":"https://api.github.com/users/tbosch/events{/privacy}","received_events_url":"https://api.github.com/users/tbosch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-13T18:55:01Z","updated_at":"2016-01-13T18:56:27Z","closed_at":null,"body":"Part of #6270\r\n\r\n## Tests\r\nTests can't override templates / directives / providers of components (Dart only):\r\nAngular will only support precompilation mode in Dart. I.e. overriding a template / ... of a component during runtime does not make sense\r\nTo mock out nested children, there will be a new method `TestComponentBuilder.overrideComponent(component, newCompHostViewFactory);`\r\n\r\nAttention: This requires to create new test component classes whenever TestComponentBuilder.override... has been used before!\r\n\r\nTestComponentBuilder.createAsync takes a const HostViewFactory instead of a component type\r\n\r\nE.g.\r\n```\r\ntestComponentLoader\r\n  .createAsync(const CodegenHostViewFactory(SomeComp));\r\n```\r\n\r\n## Bootstrap\r\ntakes a const HostViewFactory instead of a component type\r\ntakes static and dynamic providers in 2 separate arguments (see above)\r\n\r\nE.g.\r\n```\r\nbootstrap(\r\n  const CodegenHostViewFactory(AppComp),\r\n  const CodegenProviders(const [MyService]),\r\n  [new ResolvedProvider(WindowLocation, (injector) => window.location)]\r\n);\r\n\r\n```\r\n\r\n## DynamicComponentLoader\r\ntakes a const HostViewFactory instead of a component type\r\ntakes static (const) providers and dynamic providers in 2 separate arguments (see above)\r\nAttention: This requires any utility functions that uses the DynamicComponentLoader to also take a const HostViewFactory instead of a component type, as well as these 2 kinds of providers!\r\n\r\nE.g.\r\n```\r\ndynamicComponentLoader.loadNextToLocation(\r\n  myElementRef,\r\n  const CodegenHostViewFactory(SomeComp),\r\n  const CodegenProviders(const [MyService]),\r\n  [new ResolvedProvider(WindowLocation, (injector) => window.location)]\r\n);\r\n```"},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/171397262","html_url":"https://github.com/angular/angular/issues/6466#issuecomment-171397262","issue_url":"https://api.github.com/repos/angular/angular/issues/6466","id":171397262,"user":{"login":"tbosch","id":690815,"avatar_url":"https://avatars.githubusercontent.com/u/690815?v=3","gravatar_id":"","url":"https://api.github.com/users/tbosch","html_url":"https://github.com/tbosch","followers_url":"https://api.github.com/users/tbosch/followers","following_url":"https://api.github.com/users/tbosch/following{/other_user}","gists_url":"https://api.github.com/users/tbosch/gists{/gist_id}","starred_url":"https://api.github.com/users/tbosch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbosch/subscriptions","organizations_url":"https://api.github.com/users/tbosch/orgs","repos_url":"https://api.github.com/users/tbosch/repos","events_url":"https://api.github.com/users/tbosch/events{/privacy}","received_events_url":"https://api.github.com/users/tbosch/received_events","type":"User","site_admin":false},"created_at":"2016-01-13T18:56:27Z","updated_at":"2016-01-13T18:56:27Z","body":"Note: This also needs a part in transformers that assert that all calls to `CodegenHostViewFactory` and `CodegenProviders` are done with a `const` keyword!"}}