docs: import bootstrapApplication from platform-browser in the CSP example

The `CSP_NONCE` example in the security guide imports `bootstrapApplication`
from `@angular/core`, which does not export it, so copying the snippet fails
with "has no exported member named 'bootstrapApplication'". It is exported from
`@angular/platform-browser`, which is where every other example in the docs
imports it from.

Keep `CSP_NONCE` on `@angular/core` and import `bootstrapApplication` from
`@angular/platform-browser`.

(cherry picked from commit c097c0144c)
This commit is contained in:
Kam
2026-09-11 13:13:44 +03:00
committed by Andrew Scott
parent 66d6e81db2
commit 4b5571c324
+2 -1
View File
@@ -155,7 +155,8 @@ You can set the nonce for Angular in one of the following ways:
1. Provide the nonce using the `CSP_NONCE` injection token. Use this approach if you have access to the nonce at runtime and you want to be able to cache the `index.html`.
```ts
import {bootstrapApplication, CSP_NONCE} from '@angular/core';
import {CSP_NONCE} from '@angular/core';
import {bootstrapApplication} from '@angular/platform-browser';
import {AppComponent} from './app/app.component';
bootstrapApplication(AppComponent, {