File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -44,4 +44,3 @@ <h1>md-checkbox: Basic Example</h1>
4444</ div >
4545
4646< h1 > Nested Checklist</ h1 >
47- < md-checkbox-demo-nested-checklist > </ md-checkbox-demo-nested-checklist >
Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ export class MdCheckbox implements ControlValueAccessor {
148148 @Output ( ) change : EventEmitter < MdCheckboxChange > = new EventEmitter < MdCheckboxChange > ( ) ;
149149
150150 /** Event emitted when the checkbox's `indeterminate` value changes. */
151- @Output ( ) indeterminateChange : EventEmitter < Boolean > = new EventEmitter < Boolean > ( ) ;
151+ @Output ( ) indeterminateChange : EventEmitter < boolean > = new EventEmitter < boolean > ( ) ;
152152
153153 /** The native `<input type="checkbox"> element */
154154 @ViewChild ( 'input' ) _inputElement : ElementRef ;
@@ -214,14 +214,17 @@ export class MdCheckbox implements ControlValueAccessor {
214214 }
215215
216216 set indeterminate ( indeterminate : boolean ) {
217+ let changed = indeterminate != this . _indeterminate ;
217218 this . _indeterminate = indeterminate ;
218219 if ( this . _indeterminate ) {
219220 this . _transitionCheckState ( TransitionCheckState . Indeterminate ) ;
220221 } else {
221222 this . _transitionCheckState (
222223 this . checked ? TransitionCheckState . Checked : TransitionCheckState . Unchecked ) ;
223224 }
224- this . indeterminateChange . emit ( this . _indeterminate ) ;
225+ if ( changed ) {
226+ this . indeterminateChange . emit ( this . _indeterminate ) ;
227+ }
225228 }
226229
227230 /** The color of the button. Can be `primary`, `accent`, or `warn`. */
You can’t perform that action at this time.
0 commit comments