Skip to content

Commit

Permalink
fix: changed ngOnInit to ngAfterViewInit (#2349)
Browse files Browse the repository at this point in the history
* fix: changed ngOnInit to ngAfterViewInit

* removed extra ,
  • Loading branch information
rengare committed Apr 14, 2020
1 parent 11654a3 commit b1aaced
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions libs/core/src/lib/radio/radio-button/radio-button.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {
ViewChild,
ChangeDetectionStrategy,
OnChanges,
OnInit,
ViewEncapsulation
ViewEncapsulation,
AfterViewInit
} from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
import { applyCssClass, CssClassBuilder } from '../../utils/public_api';
Expand All @@ -29,7 +29,7 @@ let uniqueId = 0;
}
]
})
export class RadioButtonComponent implements OnChanges, OnInit, CssClassBuilder, ControlValueAccessor {
export class RadioButtonComponent implements OnChanges, AfterViewInit, CssClassBuilder, ControlValueAccessor {
/** @hidden */
@ViewChild('inputElement')
inputElement: ElementRef;
Expand All @@ -39,21 +39,21 @@ export class RadioButtonComponent implements OnChanges, OnInit, CssClassBuilder,
* By default field is set to false
*/
@Input()
compact: boolean;
compact: boolean = false;

/** The field to set state of radio button using:
* 'success' | 'error' | 'warning' | 'default' | 'information'
* by default value is set to 'default'
*/
@Input()
state: stateType;
state: stateType = 'default';

/** The field is used to tell if radio button should be disabled
* Value: true or false
* by default disabled state is set to false
*/
@Input()
disabled: boolean;
disabled: boolean = false;

/** The field should be only used with reactive forms
* Its purpose is to pass a current selected value from froumGroup
Expand Down Expand Up @@ -106,7 +106,7 @@ export class RadioButtonComponent implements OnChanges, OnInit, CssClassBuilder,
}

/** @hidden */
ngOnInit(): void {
ngAfterViewInit(): void {
this.buildComponentCssClass();
this._checkMandatoryFields();
}
Expand Down Expand Up @@ -140,11 +140,11 @@ export class RadioButtonComponent implements OnChanges, OnInit, CssClassBuilder,
}
// End implementation

@applyCssClass
/** This method is responsible for building a css class based on current state
* It is implementation of CssClassBuilder interface and
* should be used with @applyCssClass decorator
*/
@applyCssClass
buildComponentCssClass(): string {
return [
'fd-radio',
Expand Down

0 comments on commit b1aaced

Please sign in to comment.