From the course: The DOM in JavaScript, jQuery, AngularJS, and React
Unlock the full course today
Join today to access over 22,700 courses taught by industry experts or purchase this course individually.
Updating the DOM tree
From the course: The DOM in JavaScript, jQuery, AngularJS, and React
Updating the DOM tree
- [Instructor] In this movie, I'm going to show you how to update a DOM tree using AngularJS. So here in this example page, I'm using the shoppinglist.html file, I have a list of items I want to buy at the store. So, what I want to do, is I should be able to click each of these items here. So when I click on the Egg or the Cheese or the Bread, it should look like you see in number one, here. It's going to cross out, that's been purchased, and so on. And not only that, I should be able to also add new item to the list as well. So if I say Butter, I click Add, and that's going to add it to the list. And then finally, I want to delete these items from the list. Okay, so, let's go to Brackets and see how that's done. So here in Brackets, I opened this shopping list file. I already included the AngularJS library, as well as a custom script here. So the first thing I want to do, is you want to bootstrap this to Angular. To do that is, right here at the top of the html tag, I'm going to…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.