Issue 1:
I'm submitting a ... (check one with "x")

[X] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

After updating to Angular 4 code below throws errors (Cannot read property 'instance' of undefined). It was working without any problems before update:

export` const entity = new InjectionToken<string>('entity');

export class BaseComponent {
protected entity<string>;
constructor(injector: Injector) {
...
this.entity = injector.get(entity)
}
}

@Component({
...
providers: [{provide: entity, useValue: 'whoCares'}]
})
export class InheritorComponent {
constructor(injector: Injector) {
super(injector)
}
}

Expected behavior

I excepted InheritorComponent to be initialized with provided data via token.

Minimal reproduction of the problem with instructions

Here is working example:

http://plnkr.co/edit/CQLX3D5WWjixnzV5zQgN?p=preview

Here is unwoking (to brake it uncomment 26 line of app.ts)

http://plnkr.co/edit/5yeUn0j1VxASsAD0657n?p=preview

Code is similar. The only difference is angular version.

Please tell us about your environment:

Angular version: 4.0.X

Browser: [all ]

Language: [TypeScript 2.2]

Node (for AoT issues): node --version = 6.9.2

Issue 2:
I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

After updating from 4.0.0-rc.2 to 4.0.0 Router not injected as expected

Expected behavior

Should be injected as expected

Minimal reproduction of the problem with instructions

Plunker: http://plnkr.co/edit/ogCHjeYuCDM8vNLdwAFx?p=preview

Update from 4.0.0-rc.2 to 4.0.0

ConfigService provided in AppModule as APP_INITIALIZER

providers: [
ConfigService,
{
provide: APP_INITIALIZER,
useFactory: configServiceFactory,
deps: [ConfigService],
multi: true
}
],

ApiService injected manually from ConfigService

@Injectable()
export class ConfigService {

private api: ApiService;

public constructor(
private injector: Injector
) {

// Avoid cyclid dependencies, inject manually:
this.api = injector.get(ApiService);
}

router is undefined when injected in ApiService

import { Http, Headers, RequestOptionsArgs, Response } from '@angular/http';
import { Router } from '@angular/router';

@Injectable()
export class ApiService {

constructor(
private router: Router,
private http: Http
) {

console.log(router, 'router'); // undefined
debugger;

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

@angular/cli: 1.0.0

node: 7.4.0

os: win32 x64

@angular/animations: 4.0.0

@angular/common: 4.0.0

@angular/compiler: 4.0.0

@angular/compiler-cli: 4.0.0

@angular/core: 4.0.0

@angular/forms: 4.0.0

@angular/http: 4.0.0

@angular/platform-browser: 4.0.0

@angular/platform-browser-dynamic: 4.0.0

@angular/platform-server: 4.0.0

@angular/router: 4.0.0

@angular/material: 2.0.0-beta.2

@angular/flex-layout: 2.0.0-rc.1

@angular/cli: 1.0.0

@ngtools/webpack: 1.3.0

Angular version: 4.0.0

Browser: all

Language: TypeScript 2.2.1

Node (for AoT issues): node --version = 7.4.0

The log given by the failure.

core.es5.js:1085 ERROR TypeError: Cannot read property 'url' of undefined
at CatchSubscriber.selector (api.service.ts:127)
at CatchSubscriber.error (catch.js:104)
at MapSubscriber.Subscriber._error (Subscriber.js:128)
at MapSubscriber.Subscriber.error (Subscriber.js:102)
at XMLHttpRequest.onLoad (http.es5.js:1210)
at ZoneDelegate.invokeTask (zone.js:363)
at Object.onInvokeTask (core.es5.js:4136)
at ZoneDelegate.invokeTask (zone.js:362)
at Zone.runTask (zone.js:166)
at XMLHttpRequest.ZoneTask.invoke (zone.js:416)
defaultErrorLogger @ core.es5.js:1085
ErrorHandler.handleError @ core.es5.js:1145
next @ core.es5.js:4774
schedulerFn @ core.es5.js:3848
SafeSubscriber.__tryOrUnsub @ Subscriber.js:234
SafeSubscriber.next @ Subscriber.js:183
Subscriber._next @ Subscriber.js:125
Subscriber.next @ Subscriber.js:89
Subject.next @ Subject.js:55
EventEmitter.emit @ core.es5.js:3834
NgZone.triggerError @ core.es5.js:4205
onHandleError @ core.es5.js:4166
ZoneDelegate.handleError @ zone.js:334
Zone.runTask @ zone.js:169
ZoneTask.invoke @ zone.js:416
Navigated to http://localhost:4200/
core.es5.js:3053Template parse warnings:
The <template> element is deprecated. Use <ng-template> instead ("[WARNING ->]<template><div class="mat-autocomplete-panel" role="listbox" [id]="id" [ngClass]="_getClassList()" #p"): ng:///MdAutocompleteModule/MdAutocomplete.html@0:0
Console.warn @ core.es5.js:3053
TemplateParser.parse @ compiler.es5.js:11508
JitCompiler._compileTemplate @ compiler.es5.js:25195
(anonymous) @ compiler.es5.js:25119
JitCompiler._compileComponents @ compiler.es5.js:25119
createResult @ compiler.es5.js:25004
ZoneDelegate.invoke @ zone.js:330
Zone.run @ zone.js:126
(anonymous) @ zone.js:679
ZoneDelegate.invokeTask @ zone.js:363
Zone.runTask @ zone.js:166
drainMicroTaskQueue @ zone.js:529
api.service.ts:31 undefined "router"