Join Ray Villalobos for an in-depth discussion in this video Adding records to our database, part of AngularJS 1: Building a Data-Driven App (2015).
- In the last video, we created a form that allows users…to add meetings to our database.…Let's go ahead and write the controller…that's going to take care of that…and we'll take a look at how we interface…with our authentication service.…I'm going to go into the meetings.js controller…and I need to add a bunch of dependencies right here…so I'm going to make this window bigger.…And in addition to requiring the scope,…I'm going to need some other things here so,…it's going to need also rootScope.…
rootScope is sort of the global scope…where we can store information…that we want any controller to have access to.…In this case, what we are interested in…is the current user's information…that we get when a user is authenticated.…I'm opening up here the authentication.js file.…What happens when a user is logged in…is that an authentication event takes place.…We capture that event right here.…When that happens, we ask Firebase…to give us all the data it has about the current user.…
It puts all that data into this rootScope.currentUser…
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