-
-
Notifications
You must be signed in to change notification settings - Fork 902
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
Conversation
src/ng-select/ng-select.component.ts
Outdated
@@ -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>(); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
src/ng-select/ng-select.component.ts
Outdated
@@ -704,4 +713,4 @@ export class NgSelectComponent implements OnInit, OnDestroy, OnChanges, AfterVie | |||
this.clearAllText = this.clearAllText || config.clearAllText; | |||
this.disableVirtualScroll = this.disableVirtualScroll || config.disableVirtualScroll; | |||
} | |||
} | |||
} |
There was a problem hiding this comment.
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.
…nd having a change emitter
…same and having a change emitter (ng-select#206) closes ng-select#205
this allows to expose
isLoading
safely and having a EventEmitter so it can be listened on and changed from outside.