I've already done a bit of reading and searching and pretty much everything I find points to that a script tag cannot be included in a template in Angular 2.
we are removing tags from templates on purpose as you shouldn't use those to load code on demand. https://github.com/angular/angular/issues/4903 [2015]
However - there is a function bypassSecurityTrustScript
I'd like to know when and how bypassSecurityTrustScript
in Angular 2 is intended to be used?
I know a similar question has been asked:
Angular2 dynamically insert script tag - though no one answered their question of how to use bypassSecurityTrustScript
, and I'm not sure how the provided answer to that question could even work as it appears to use JavaScript within a template.
DomSanitizer
. – Tarantass