mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
docs(docs-infra): update NG0910 documentation with new control flow
This commit is contained in:
parent
7b33554d24
commit
27d1ccb2df
1 changed files with 8 additions and 4 deletions
|
|
@ -52,10 +52,14 @@ The recommended solution is to use the mentioned attributes as static ones, for
|
|||
```
|
||||
|
||||
If you need to have different values for these attributes (depending on various conditions),
|
||||
you can use an `*ngIf` or an `*ngSwitch` on an `<iframe>` element:
|
||||
you can use the `@if` or `@switch` control flow blocks to conditionally render the appropriate `<iframe>` element:
|
||||
|
||||
```angular-html
|
||||
<iframe *ngIf="someConditionA" sandbox="allow-scripts" src="..."></iframe>
|
||||
<iframe *ngIf="someConditionB" sandbox="allow-forms" src="..."></iframe>
|
||||
<iframe *ngIf="someConditionC" sandbox="allow-popups" src="..."></iframe>
|
||||
@if (someConditionA) {
|
||||
<iframe sandbox="allow-scripts" src="..."></iframe>
|
||||
} @else if (someConditionB) {
|
||||
<iframe sandbox="allow-forms" src="..."></iframe>
|
||||
} @else {
|
||||
<iframe sandbox="allow-popups" src="..."></iframe>
|
||||
}
|
||||
```
|
||||
|
|
|
|||
Loading…
Reference in a new issue