Check out example codes for "Cannot read property 'bypassSecurityTrustResourceUrl'". It will help you in understanding the concepts better.

Code Example 1

// This error is not about what you pass as an argument, 
// but about the sanitizer.
// You need to make sure to import and declare the sanitizer 
// in your constructor like this:

import { DomSanitizer} from '@angular/platform-browser';

...

constructor(private sanitizer:DomSanitizer) {    }

Learn ReactJs, React Native from akashmittal.com