We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 65503cc commit c521875Copy full SHA for c521875
1 file changed
Projects/Weather APP/main.js
@@ -0,0 +1,20 @@
1
+import CurrentLocation from "./currentLocation.js";
2
+import { getDataFromApi } from "./DataFunction.js";
3
+import { getDataFromSearch, DisplayDataInApp } from "./domFunction.js";
4
+
5
+const currentLoc = new CurrentLocation();
6
7
+const initApp = () => {
8
+ const searchBar = document.getElementById("search__form");
9
+ searchBar.addEventListener("submit", getDataFromUser);
10
+ getDataFromApi(currentLoc);
11
+ DisplayDataInApp(currentLoc);
12
+};
13
14
+const getDataFromUser = (event) => {
15
+ event.preventDefault();
16
+ const location = getDataFromSearch();
17
+ currentLoc.location = location;
18
+ initApp();
19
20
+initApp();
0 commit comments