No provider for DomSanitizer


#1

Hello,

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';
and
constructor(private sanitizer: DomSanitizer) {}
to my component et I have a “No provider for DomSanitizer !” error.

Any idea ?
Thanks !
serge


#2

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

http://embed.plnkr.co/n1Ye3pQY6dlMSoJizO6Y/


#3

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 !


#4

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…