Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jay J Kim
weather
Commits
2bdc3c5f
Commit
2bdc3c5f
authored
Jul 16, 2016
by
Zach Knox
Browse files
Supposedly there is now data in the database now
Now to make it usable...
parent
093f1e30
Changes
2
Hide whitespace changes
Inline
Side-by-side
weather/imports/api/data.js
View file @
2bdc3c5f
...
...
@@ -2,3 +2,18 @@
import
{
Mongo
}
from
'
meteor/mongo
'
;
export
const
WeatherData
=
new
Mongo
.
Collection
(
'
weather-data
'
);
for
(
var
key
in
LOCATIONS
)
{
const
current
=
LOCATIONS
[
key
];
var
currentData
Meteor
.
call
(
'
weatherDataForLoc
'
,
current
.
lat
,
current
.
long
,
function
(
err
,
res
){
currentData
=
res
});
WeatherData
.
insert
({
name
:
current
.
name
,
lat
:
current
.
lat
,
long
:
current
.
long
,
data
:
currentData
,
lastUpdated
:
new
Date
(),
});
}
weather/imports/ui/dataview.js
View file @
2bdc3c5f
...
...
@@ -5,7 +5,7 @@ import { WeatherData } from '../api/data.js';
import
'
../../client/weather.html
'
;
Template
.
body
.
helpers
({
export
function
current
()
{
current
()
{
return
WeatherData
.
find
({});
},
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment