question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

how to change options in the timeout

See original GitHub issue
options: Options = {
  floor: 0,
  ceil: 0
}
setTimeout(()=>{
  this.options.ceil = 300; // i want to change it later
})

I did not understand even by looking at the document.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

5reactions
piotrdzcommented, Aug 4, 2018

Apologies for not replying earlier. I was on holiday with limited internet access. I hope that you found a solution for your problem.

In this case, it’s due to how Angular change detection works on objects. It won’t pick up the change to the nested value, because it does a quick and dirty comparison of object identity. However, there is a workaround, which is to re-create the object:

setTimeout(() => {
  const newOptions = Object.assign({}, this.options);
  newOptions.ceil = 300;
  this.options = newOptions;
});
0reactions
AdrienHorgniescommented, Dec 7, 2018

Here is the setup I used if it can be of any use:

        <ng5-slider (userChange)="onFilterFormChanges()" [(highValue)]="filters.priceMax.value"
                    [(value)]="filters.priceMin.value" [options]="{
        floor: minPrice | async,
        ceil: maxPrice | async,
        step: 10,
        translate: sliderText
    }"></ng5-slider>
    ngOnInit() {
        this.minPrice = this.spaceService.minPrice().pipe(
            tap(value => this.filters.priceMin.value = value),
            startWith(20)
        );
        this.maxPrice = this.spaceService.maxPrice().pipe(
            tap(value => this.filters.priceMax.value = value),
            startWith(2900)
        );
    }

I couldn’t get rid of a null pointer exception without the startWith and I need the tap as I use double binding with another member of the class.

That is the cleanest solution that suited my flow. This way I must not unsubscribe myself and I can nicely handled any event using a single EventEmitter which I subscribe with the component holding the result list of my search query. full code

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Change or Disable the Lock Screen Timeout on ...
Method 4: Use the Power Options to change the lock screen timeout · Press the Windows + R keys using your keyboard to...
Read more >
How to Change the Lock Screen and Screen Saver Timeout ...
Press Win + I to open the system settings. · Select the Personalization option from the menu items. · Click the Lock screen...
Read more >
How to Change the Windows 10 Lock Screen Timeout
In the Power Options dialog, expand the “Display” item and you'll see the new setting you added listed as “Console lock display off...
Read more >
How to Change Internet Timeout Options
Go to the "Edit" menu, choose "New" and then select "DWORD Value." 5. Type "KeepAliveTimeout" into the dialog box and hit the "Enter"...
Read more >
Setting System Timeouts
Select the Settings button on the Home screen. · The Settings screen displays. · Select Timeouts. · Select the appropriate timeout from the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found