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

wrap isLoading in a getter and setter loading #206

Merged
merged 1 commit into from
Jan 25, 2018

Conversation

marvinosswald
Copy link
Contributor

this allows to expose isLoading safely and having a EventEmitter so it can be listened on and changed from outside.

@coveralls
Copy link

coveralls commented Jan 24, 2018

Coverage Status

Coverage increased (+0.06%) to 90.355% when pulling 9f5a75b on marvinosswald:master into b4c3181 on ng-select:master.

@@ -113,6 +113,15 @@ export class NgSelectComponent implements OnInit, OnDestroy, OnChanges, AfterVie
get single() {
return !this.multiple;
}
@Output('loadingChange') loadingChange: EventEmitter<Boolean> = new EventEmitter<Boolean>();
Copy link
Member

Choose a reason for hiding this comment

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

Type : EventEmitter<Boolean> annotation can be removed as it is known from instance and will be automatically inferred by Typescript.

return this.isLoading;
}
@Input()
set loading(value: boolean) {
Copy link
Member

Choose a reason for hiding this comment

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

This looks super cool. It would be great if you can add demo with use case. You can put it in demo app reactive-forms.component.ts or create your own showing custom loading.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

would like to have it there and may add a demo in the future but right now i can't

return this.isLoading;
}
@Input()
set loading(value: boolean) {
Copy link
Member

Choose a reason for hiding this comment

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

It would be great if you can update README.md and add these new API input and output to documentation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added it to README.md

@@ -704,4 +713,4 @@ export class NgSelectComponent implements OnInit, OnDestroy, OnChanges, AfterVie
this.clearAllText = this.clearAllText || config.clearAllText;
this.disableVirtualScroll = this.disableVirtualScroll || config.disableVirtualScroll;
}
}
}
Copy link
Member

@anjmao anjmao Jan 24, 2018

Choose a reason for hiding this comment

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

Ups. Probably tslint will fail, for some reasons webpack is not showing warnings for eofline rule.

@anjmao anjmao merged commit cd3dec1 into ng-select:master Jan 25, 2018
jakemdunn pushed a commit to jakemdunn/ng-select that referenced this pull request Oct 16, 2018
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

3 participants