So I've upgrade from RC1 to the final release of Angular2. I've done a lot of adjustments but every time I injected RuntimeCompiler
on my AppComponent
, this error occurs.
I have no idea what is happening here and haven't seen the answers for the web regarding this issue. Any help would be appreciated, anyway here is my AppComponent for reference.
import { Component } from '@angular/core';
import { Location } from '@angular/common';
import { Router } from '@angular/router';
import { RuntimeCompiler } from '@angular/compiler';
@Component({
selector: 'content',
template: '<router-outlet></router-outlet>'
})
export class AppComponent {
constructor(
private location: Location,
private router: Router,
private runtimeCompiler: RuntimeCompiler
) {;
if (localStorage.getItem('id_token') == undefined) {
if (location.path().toLowerCase().startsWith('/login')) {
// LET IT BE
} else {
router.navigate(['login']);
}
runtimeCompiler.clearCache();
} else {
router.navigate(['menu']);
}
}
}
Thank you in advance.