I am trying to fulfill the accepted answer here and make a call to RuntimeCompiler.clearCache ()
Here is how I tried to do this:
import { Component } from '@angular/core';
import { OnInit } from '@angular/core';
import { RuntimeCompiler } from '@angular/compiler';
@Component({
moduleId: module.id,
selector: 'my-app',
templateUrl: 'app.component.html',
})
export class AppComponent implements OnInit {
constructor(private _runtimeCompiler: RuntimeCompiler) {}
ngOnInit() {
this._runtimeCompiler.clearCache();
}
}
But I get this error:
ORIGINAL EXCEPTION: No provider for RuntimeCompiler!
What am I missing here?
source
share