No provider for DomSanitizer



I’ve got an issue and cannot solve it for 2 days. It looks very simple…
I’ve just added:
import { DomSanitizer } from '@angular/platform-browser';
constructor(private sanitizer: DomSanitizer) {}
to my component et I have a “No provider for DomSanitizer !” error.

Any idea ?
Thanks !


Same error on plunker but it’s worked at local.


Thanks for the plunker !
I don’t understand the issue, I have read the documentation and I can’t see any declaration to add…
Do you think I should open an issue on Angular Github ?

Thanks !


I found the solution: DomSanitizer is defined in BrowserModule that is importerd in default angular projects, but not in Nativescript.
But DomSanitizer is not usefull in NS cause we don’t have a DOM…