Join Ray Villalobos for an in-depth discussion in this video Adding random functionality, part of AngularJS 1: Building a Data-Driven App.
- So I'd like to add another bit…of functionality to this app.…Occasionally during a meeting, I like to pick a random user…so that perhaps I can do a giveaway at the meetings.…So in order to add that functionality to the app,…I'm going to create another section…right underneath this form.…Let's go ahead and label these.…These are, right now, not labeled,…and it's always a good idea to give these things comments,…just so you know what everything is.…So this is formgroup here,…and this other one is for search.…
So right before the closing tag for search,…we're going to add a new section; it's going to be a div,…and this is going to be only shown…if the current user exists and is logged in,…and I'll give it a class of buttons,…and a clearfix class.…And so what we're going to do is create two buttons:…one that is going to pick a random user, right here,…and then another one that is going to allow us…to reset the amount of users that are being displayed.…
So I'm going to have to create a variable…that is going to have the value of the record…
Although it's easy to learn, AngularJS can be hard to master. With these project-based lessons, you'll learn how the framework works in the real world, and see how data-driven programming can help your apps react to real-time data streams.
- Creating a new view
- Adding, showing, and deleting database records
- Using events to track meetings
- Adding a form to the app
- Creating methods
- Controlling views with classes