Pav*_*S57 6 dart angular-dart angular
我有简单的Angular-Dart组件,尝试ngModel在单选输入中将connect属性设置为,应用正确编译,但是浏览器控制台给我错误:
No provider found for RadioControlRegistry: RadioControlValueAccessor -> RadioControlRegistry.
Run Code Online (Sandbox Code Playgroud)
代码:
import 'package:angular/angular.dart';
import 'package:angular_forms/angular_forms.dart';
@Component(
selector: 'order-question-test',
template: '''
<input type="radio" name="food" [(ngModel)]="foodChicken">
<input type="radio" name="food" [(ngModel)]="foodFish">
''',
directives: [
coreDirectives,
formDirectives,
]
)
class OrderQuestion {
RadioButtonState foodChicken = RadioButtonState(true, "chicken");
RadioButtonState foodFish = RadioButtonState(false, "fish");
OrderQuestion ();
}
Run Code Online (Sandbox Code Playgroud)
pubspec.yaml
environment:
sdk: '>=2.2.0 <3.0.0'
dependencies:
angular: ^5.2.0
angular_components: ^0.13.0
json_annotation: ^2.0.0
dev_dependencies:
angular_test: ^2.2.0
build_runner: ^1.5.0
build_test: ^0.10.3
build_web_compilers: ^1.0.0
json_serializable: ^2.0.0
pedantic: ^1.0.0
test: ^1.5.1
Run Code Online (Sandbox Code Playgroud)
怎么了?
尝试在提供者数组RadioControlRegistry下添加
providers: [ClassProvider(RadioControlRegistry)]
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
102 次 |
| 最近记录: |