Skip to content

Instantly share code, notes, and snippets.

@ChristopherJohnson25
Created May 15, 2018 12:20
Show Gist options
  • Save ChristopherJohnson25/20056a4bb09784f3a094028956474c51 to your computer and use it in GitHub Desktop.
Save ChristopherJohnson25/20056a4bb09784f3a094028956474c51 to your computer and use it in GitHub Desktop.
viti rundown
So bascially, user location is gotten in the application controller. This gets saved as userLocation, and accessed via computer property on other routes controllers. It's only needed on vineyard/index and vineyard/show routes. Seems like the right away to do this...
Once user location is recieved and accessible via the template, it is passed to the miles-away component along with vineyardLocation (address string, Google is smart enough to handle these, even if the user inputs wrong zips, spells things wrong etc etc).
The component miles-away then takes these two parameters and runs the long function you see in miles-away.js. Now the way this is setup seems like really poor execution. It renders how many miles away a vineyard is, but gives me no way to sort. That should make sense just by looking at the handlebars templates.
Do I put this whole list in my component? I'm using ember composable helpers, so sorting should work nicely when I can get the distanceFrom at the model level?? This is the absolute max of my Ember comfortability.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment