-
Notifications
You must be signed in to change notification settings - Fork 773
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
initial value of ObservableMedia #240
Comments
Issues are considered invalid without a working Plunkr or CodePen demo. Also here are some important guidelines for investigating a Layout issue:
Templates |
Closing as invalid without demo. |
I've also experienced the same issue where the initial value is not emitted. Furthermore, there is some very strange behaviour that I'm experiencing with all the fxLayout, fxFlex directives. For instance, |
The issue is clearly described and happens also in my project. Demo is unnecessary, its the standard behavior. Closed Bugs like this don't exist? Or how should I interpret the answer? The initial value for the Observable is invalid, you receive a valid value only if you change your browser window to the next Breakpoint. |
@rolandjitsu, @benjamindamm - Are you using the latest nightly releases? We are not seeing this issue on our online demos (which use the latest builds). |
@ThomasBurleson I am using |
Yes you are right. But the error still exists. I don't want to create my own service, if there is a good solution from angular already. Even the Observer on changing the screen size works very lazy. In some moments it works but mostly not. The initial value works never unfortunately. I am using 2.0.0.beta.8 Sorry for reopening, if you already fixed that. But I run in this error and found no solution in these threads. Btw I'm trying this way:
Well so this console.log, never executes on startup. It should get called in my constructor of the component. On changing the screen size in my browser, it gets fired sometimes. If I resize very slowly. fxLayout doesn't help me, I need the JS-way. If I am doing it wrong, let us post a solution here, if any other runs into this error. Closed threads without any solution are helpless for others. |
@benjamindamm - the nightly builds (code in master that will be released with Beta.9) should fix this issue. Do you see this same issue occurring in our Online Demos (Responsive Tab) ?
|
Fixed |
I am using @angular/flex-layout 6.0.0-beta.16 and this does not seem to be fixed. Is there any trick to getting the observable media to fire upon OnInit? |
@nukuuk The current workaround is add a listener in the constructor as MediaService uses BehaviourSubject internally #245 (comment) The working plunker - https://plnkr.co/edit/yylQr2IdbGy2Yr00srrN?p=preview |
@mihalcan thanks for that I'll try it out! |
Just for the record, noted this issue still exists in 7.0.0-beta.24. I am using the suggestion made by @mihalcan |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Hi.
If I subscribe to observable media I don't receive first notification about initial media query if on 'md' and larger devices. If I am on 'sm' or 'xs' devices, my subscription gets invoked with initial value as expected. If I change size of the browser window, I get all notifications as expected.
How can I get the media query after initialization on devices bigger than 'md'?
Thanks.
The text was updated successfully, but these errors were encountered: