├── README.md ├── index.html └── js ├── app.js └── summary.js /README.md: -------------------------------------------------------------------------------- 1 | # phone-hunter 2 | 3 | ## API Links 4 | 5 | ### Phone Search 6 | URL Format: https://openapi.programming-hero.com/api/phones?search=${searchText} 7 | 8 | Example: https://openapi.programming-hero.com/api/phones?search=iphone 9 | 10 | 11 | ### Phone detail url: 12 | URL Format: https://openapi.programming-hero.com/api/phone/${id} 13 | 14 | 15 | Example: https://openapi.programming-hero.com/api/phone/apple_iphone_13_pro_max-11089 16 | 17 | 18 | ## issue List 19 | 1. Search button not working 20 | 2. after typing something on the search textbox, you should be able to press enter to get search result 21 | 3. spinner is always running. should be displayed at the time of data loading 22 | 4. If you search for 'iphone', check the api, you should get a lot of data but the UI displays only one phone 23 | 5. Search is not clearing previous results 24 | 6. picture of the phones are not showing 25 | 7. Show All button should be hidden after all data is loaded 26 | 8. Load phone details doesn't display anything 27 | 9. Phone details are added on the modal but this is not getting displayed. why? 28 | 10. Storage on Modal isn't getting displayed properly 29 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 |This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
40 | 41 | 42 |Release Date: ${phone.releaseDate}
102 |Storage: ${phone.mainFeatures}
103 |Others: ${phone.others ? phone.others.Bluetooth : 'No Bluetooth Information'}
104 |Sensor: ${phone.mainFeatures.sensors ? phone.mainFeatures.sensors[0] : 'no sensor'}
105 | ` 106 | } 107 | 108 | loadPhones('apple'); -------------------------------------------------------------------------------- /js/summary.js: -------------------------------------------------------------------------------- 1 | /* 2 | FETCH 3 | 1. Fetch must provide url 4 | dynamic or static 5 | 2. how to convert fetch promise return to json 6 | 3. how to convert json to data 7 | 4. [cool headed]: 8 | users: 9 | --> array of objects 10 | --> object with property users 11 | ---> object with a property called data 12 | 13 | nested object 14 | 15 | 16 | --------------- 17 | DOM manipulation 18 | 1. get something from the DOM 19 | 2. create element to append to the DOM 20 | 3. dynamically load data based on id 21 | 22 | ---------------- 23 | array --> forEach, map, find, filter 24 | ------------------------ 25 | template string 26 | 27 | 28 | 29 | */ --------------------------------------------------------------------------------