Skip to content

Commit 60ba6dd

Browse files
committed
fix(core): Rename valueChanges to controLValueChanges
This is aimed to reduce the chance of a name collision with the component to which the directive is applied. fixes #54
1 parent 33206f4 commit 60ba6dd

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

projects/ngqp-demo/src/app/docs-items/examples/control-value-accessor-directive-example/control-value-accessor-directive-example.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<demo-pagination #paginator [numberOfPages]="5"
55
controlValueAccessor #accessor="controlValueAccessor"
66
(currentPageChange)="accessor.notifyChange($event)"
7-
(valueChange)="paginator.currentPage = $event"
7+
(controlValueChange)="paginator.currentPage = $event"
88
queryParamName="page">
99
</demo-pagination>
1010
</ng-container>

projects/ngqp/core/src/lib/control-value-accessor.directive.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
1111
* <app-item-selector #ctrl
1212
* controlValueAccessor #accessor="controlValueAccessor"
1313
* (itemChange)="accessor.notifyChange($event)"
14-
* (valueChange)="ctrl.item = $event">
14+
* (controlValueChange)="ctrl.item = $event">
1515
* </app-item-selector>
1616
*/
1717
@Directive({
@@ -34,8 +34,8 @@ export class ControlValueAccessorDirective<T> implements ControlValueAccessor {
3434
* writeValue. You should bind to this event and update your component's
3535
* state with the given value.
3636
*/
37-
@Output('valueChange')
38-
public valueChange = new EventEmitter<T>();
37+
@Output('controlValueChange')
38+
public controlValueChange = new EventEmitter<T>();
3939

4040
/**
4141
* Fired when the control's disabled change should change.
@@ -72,7 +72,7 @@ export class ControlValueAccessorDirective<T> implements ControlValueAccessor {
7272

7373
/** @internal */
7474
public writeValue(value: T) {
75-
this.valueChange.emit(value);
75+
this.controlValueChange.emit(value);
7676
}
7777

7878
/** @internal */

0 commit comments

Comments
 (0)