/
githubmirror
/
angular
Обзор
Документация
Войти
/
githubmirror
/
angular
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/examples/forms/ts/radioButtons/radio_button_example.ts
28 строк
787 B
Matthieu Riegler
refactor(core): Migrate all packages with the `explicit-standalone-flag` schematic. (#58160)
14 окт 2024, 17:58
14 окт 2024, 17:58
09df589
Код
Авторство
О чём код?
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {Component} from '@angular/core'; @Component({ selector: 'example-app', template: ` <form #f="ngForm"> <input type="radio" value="beef" name="food" [(ngModel)]="myFood" /> Beef <input type="radio" value="lamb" name="food" [(ngModel)]="myFood" /> Lamb <input type="radio" value="fish" name="food" [(ngModel)]="myFood" /> Fish </form> <p>Form value: {{ f.value | json }}</p> <!-- {food: 'lamb' } --> <p>myFood value: {{ myFood }}</p> <!-- 'lamb' --> `, standalone: false, }) export class RadioButtonComp { myFood = 'lamb'; }