Security Principles For Angular's Regular Web Applications - 1. You should avoid direct use of the DOM APIs. 2. You should enable Content Security Policy (CSP) and configure your web server to return appropriate CSP HTTP headers. 3. You should Use the offline template compiler. 4. You should Use Server Side XSS protection. 5. You should Use DOM Sanitizer. 6. You should Preventing CSRF or XSRF attacks. Example – export const BROWSER_SANITIZATION_PROVIDERS: Array < any > = [ { provide : Sanitizer , useExisting : DomSanitizer }, { provide : DomSanitizer , useClass : DomSanitizerImpl }, ]; @ NgModule ({ providers : [ BROWSER_SANITIZATION_PROVIDERS ... ], exports : [ CommonModule , ApplicationModule ] }) export class B...
Angular, React, JavaScript, Java, PHP, SQL, C#, Vue, NodeJs, TypeScript and Interview Questions Answers