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

allow for component authors to use JSDoc annotation for models #75

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jthoms1
Copy link
Member

@jthoms1 jthoms1 commented Jun 30, 2020

This PR is to allow component authors to specifiy form based 2 way bindings for Vue and Angular within the JSDoc of their components. This would take the place of 'valueAccessorConfigs' in Angular and 'componentModels' in Vue.

The comment would always go about exposed Events. The following are examples from this repo.

@bindAttr (Angular/Vue) requires an attributes that will be bound to. This annotation is for the event that you want to watch for.
@bindType (Angular) requires the type that the value should be coerced to and can take an additional value that is a more precise selector. In the case below input has a different value type depending on the input type. (text or number)

/**
 * Emitted when the value has changed.
 * @bindAttr value
 * @bindType text my-input[type=text]
 * @bindType number my-input[type=number]
 */
@Event() myChange!: EventEmitter<InputChangeEventDetail>
/**
 * Emitted when the checked property has changed.
 * @bindAttr checked
 * @bindType boolean
 */
@Event() myChange!: EventEmitter<CheckboxChangeEventDetail>

@jthoms1 jthoms1 self-assigned this Jun 30, 2020
@jthoms1 jthoms1 added the type: feature New feature, request or improvement. label Jun 30, 2020
@jthoms1 jthoms1 marked this pull request as draft July 1, 2020 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature New feature, request or improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant