Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: added toggle documentation #791

Merged
merged 2 commits into from
May 9, 2019
Merged

Conversation

InnaAtanasova
Copy link
Contributor

Please provide a link to the associated issue.

#696

Please provide a brief summary of this pull request.

Documented Toggle component

@ViewChild('input')
inputElement: ElementRef<HTMLInputElement>;

/** @Input The size of the toggle.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@input is not needed anymore, I upgraded the docs script a week ago or so :)

@netlify
Copy link

netlify bot commented May 9, 2019

Deploy preview for fundamental-ngx ready!

Built with commit b1dc724

https://deploy-preview-791--fundamental-ngx.netlify.com

@InnaAtanasova InnaAtanasova self-assigned this May 9, 2019
@Input()
checked: boolean = false;

/** @Input aria-label attribute. */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specify that this is the aria-label of the inner input element

@Input()
ariaLabel: string = null;

/** @Input aria-labelledby attribute. */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

specify that this is the aria-labelledby of the inner input element

@Input()
ariaLabelledby: string = null;

/** @Output Event fired when the toggle is checked. */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is fired when the state of the toggle changes, whether it is checked or unchecked. Also explain that $event can be used to retrieve the new state of the toggle

public focus(): void {
this.inputElement.nativeElement.focus();
}

/** Get the innerInputId property of the toggle. */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe simpler: Get the id of the inner input element of the toggle.

set isChecked(value) {
this.checked = value;
this.onChange(value);
this.onTouched();
this.checkedChange.emit(value);
}

/**
* @param value Sets the value of the *checked* property of the toggle.
*/
writeValue(value: any) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can add @hidden here since this is only used by angular forms, but keep the description as it could be useful

registerOnTouched(fn) {
this.onTouched = fn;
}

/**
* @param isDisabled Sets the value of the *disabled* property of the toggle.
*/
setDisabledState(isDisabled: boolean): void {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also add @hidden here since this is only used by angular forms

Copy link
Contributor

@MattL75 MattL75 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@InnaAtanasova InnaAtanasova merged commit bca259f into master May 9, 2019
@droshev droshev deleted the docs/#696-toggle-typedoc branch May 10, 2019 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants