@ts-core/angular 15.0.46 → 15.0.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4005,24 +4005,25 @@ class RouterSelectListItems extends SelectListItems {
4005
4005
  constructor(router, language) {
4006
4006
  super(language, true);
4007
4007
  this.router = router;
4008
- //--------------------------------------------------------------------------
4009
- //
4010
- // Protected Methods
4011
- //
4012
- //--------------------------------------------------------------------------
4013
- this.setData = () => {
4014
- this.selectedItem = this.getRouterSelectedItem();
4015
- };
4016
- this.setFragment = (item) => {
4017
- let index = _.indexOf(this.collection, item);
4018
- this.router.setFragment(index > 0 ? item.data.toString() : null);
4019
- };
4020
4008
  this.changed
4021
4009
  .pipe(filter(() => !this.isDisabled), takeUntil(this.destroyed))
4022
- .subscribe(this.setFragment);
4010
+ .subscribe(item => this.setFragment(item));
4023
4011
  this.router.completed
4024
4012
  .pipe(filter(() => !this.isDisabled), takeUntil(this.destroyed))
4025
- .subscribe(this.setData);
4013
+ .subscribe(() => this.setData());
4014
+ }
4015
+ //--------------------------------------------------------------------------
4016
+ //
4017
+ // Protected Methods
4018
+ //
4019
+ //--------------------------------------------------------------------------
4020
+ setData() {
4021
+ let item = this.getRouterSelectedItem();
4022
+ this.selectedItem = !_.isNil(item) ? item : _.first(this.collection);
4023
+ }
4024
+ setFragment(item) {
4025
+ let index = _.indexOf(this.collection, item);
4026
+ this.router.setFragment(index > 0 ? item.data.toString() : null);
4026
4027
  }
4027
4028
  getRouterSelectedItem() {
4028
4029
  return _.find(this.collection, { data: this.router.getFragment() });