X Tutup
Skip to content

Commit 3ca6df8

Browse files
committed
fix(select): update name from ng-value to ngValue
Closes angular#7939
1 parent e310bee commit 3ca6df8

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

modules/angular2/src/common/forms/directives/select_control_value_accessor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export class NgSelectOption implements OnDestroy {
9898
if (isPresent(this._select)) this.id = this._select._registerOption();
9999
}
100100

101-
@Input('ng-value')
101+
@Input('ngValue')
102102
set ngValue(value: any) {
103103
if (this._select == null) return;
104104
this._select._optionMap.set(this.id, value);

modules/angular2/test/common/forms/integration_spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ export function main() {
438438
(tcb: TestComponentBuilder, async) => {
439439
var t = `<div>
440440
<select [(ngModel)]="selectedCity">
441-
<option *ngFor="#c of list" [ng-value]="c">{{c['name']}}</option>
441+
<option *ngFor="#c of list" [ngValue]="c">{{c['name']}}</option>
442442
</select>
443443
</div>`;
444444

@@ -470,7 +470,7 @@ export function main() {
470470
(tcb: TestComponentBuilder, async) => {
471471
var t = `<div>
472472
<select [(ngModel)]="selectedCity">
473-
<option *ngFor="#c of list" [ng-value]="c">{{c['name']}}</option>
473+
<option *ngFor="#c of list" [ngValue]="c">{{c['name']}}</option>
474474
</select>
475475
</div>`;
476476

@@ -498,7 +498,7 @@ export function main() {
498498
(tcb: TestComponentBuilder, async) => {
499499
var t = `<div>
500500
<select [(ngModel)]="selectedCity">
501-
<option *ngFor="#c of list" [ng-value]="c">{{c}}</option>
501+
<option *ngFor="#c of list" [ngValue]="c">{{c}}</option>
502502
</select>
503503
</div>`;
504504
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then((fixture) => {
@@ -524,7 +524,7 @@ export function main() {
524524
(tcb: TestComponentBuilder, async) => {
525525
var t = `<div>
526526
<select [(ngModel)]="selectedCity">
527-
<option *ngFor="#c of list; trackBy:customTrackBy" [ng-value]="c">{{c}}</option>
527+
<option *ngFor="#c of list; trackBy:customTrackBy" [ngValue]="c">{{c}}</option>
528528
</select>
529529
</div>`;
530530

@@ -554,7 +554,7 @@ export function main() {
554554
(tcb: TestComponentBuilder, async) => {
555555
var t = `<div>
556556
<select [(ngModel)]="selectedCity">
557-
<option *ngFor="#c of list" [ng-value]="c">{{c}}</option>
557+
<option *ngFor="#c of list" [ngValue]="c">{{c}}</option>
558558
</select>
559559
</div>`;
560560

@@ -583,7 +583,7 @@ export function main() {
583583
(tcb: TestComponentBuilder, async) => {
584584
var t = `<div>
585585
<select [(ngModel)]="selectedCity">
586-
<option *ngFor="#c of list" [ng-value]="c">{{c['name']}}</option>
586+
<option *ngFor="#c of list" [ngValue]="c">{{c['name']}}</option>
587587
</select>
588588
</div>`;
589589

0 commit comments

Comments
 (0)
X Tutup