课程: Hands-On Introduction: JavaScript
免费学习该课程!
今天就开通帐号,24,700 门业界名师课程任您挑!
Add new data to an existing data object - JavaScript教程
课程: Hands-On Introduction: JavaScript
Add new data to an existing data object
- [Instructor] Working with data from external sources like an API, you'll often find you need to add additional information that is not in the data set. When that happens, you need to think carefully about where you add that data so your components remain editable and remain reusable. In our example, I want to add license information for each of the images, because the images are being pulled from a data source, and it's common that the images then have licenses attributed to them, and I want to display that license information right here underneath each of the images. I'll start by just propping in the HTML so I see I'm placing the information in the right place. So, in my card component at the bottom here, I'll say paragraph and then License:, set up an a href. And there'll be the link to the license, and then here, I'll say just License Name and end my a, dot, end my paragraph, and save. And, over here, we'll now see…