Join GitHub today
refactor: Create service for determining screen size #599
Great! I'm totally up for replacing the calls. One quick question: Do you have any preference as far as how the service should be exposed (on the controller, scope, rootScope, ...)? I'm leaning toward the controller, with calls from templates that look like: $ctrl.ScreenSize.isMediumOrLarger(). I think this would be the cleanest approach, in terms of replacing the calls. Let me know :) Jazz…
On Fri, Aug 25, 2017 at 8:04 AM, Tilmann Becker ***@***.***> wrote: Looks good to me! Would you be up for replacing calls to $mdMedia in our codebase with your brand new service? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#599 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AMrePOkd7rmPVY9eKlu9V8PXWd4gu4smks5sbuJzgaJpZM4O_cGR> .
Done. I added an "is" to your function name (i.e. isGtSm instead of gtSm) since it returns a boolean. Also, I realized that $mdMedia was being passed "gt-xs" in a few places, so I added another function (isGtXs) to the service. Not sure if I got everything, so any feedback would be great!…
On Sat, Aug 26, 2017 at 2:21 AM, Tilmann Becker ***@***.***> wrote: $ctrl.ScreenSize.isMediumOrLarger() That seems the best choice to me, too. Though maybe it makes sense to shorten isMediumOrLarger() to something like gtSm()? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#599 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AMrePPhQTZLrj3PrRPQx1MMnNqhJX_wGks5sb-OlgaJpZM4O_cGR> .
Aug 27, 2017
Thanks Tilmann. Happy to help!…
On Sun, Aug 27, 2017 at 3:34 AM, Tilmann Becker ***@***.***> wrote: Merged #599 <#599>. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#599 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AMrePPdSsEa1IQY6Ls98zd887EFws3Y7ks5scUZQgaJpZM4O_cGR> .
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews.