In this video Iftach Bar demonstrates simple bindings in Angular, ng-model, and ng-click and show how they are connected to the controller.
- [Narrator] Now that we have a controller in place,…let's remember the different ways…we can take advantage of…the beautiful features angular provides.…The simplest one is the curly braces syntax,…which allows us to bind a variable to the dome.…We'll create a variable called force…and put it on the scope.…And then, we'll bind this variable to the dome.…First, we'll need to inject the scope variable…into our controller.…And we're going to add a new attribute on scope…called force.…
Let's initialize its value to 30.…I'll go back to the index html file,…and I'm going to change this text into a new div.…And this div will just write "how strong is the force".…And I'm going to use the curly braces…in order to bind force here.…Let's save and run and see what happens.…As we expect, we see that the variable force…is bound here to the dome.…
Let's have a look at another way we can bind variables…through an input field.…I'm going to create a new input field below this div.…And I'm going to bind the force using ng-model attribute.…
This advanced AngularJS course helps you explore the connected worlds of $scope and the digest cycle. Instructor Iftach Bar explains scope and inheritance, goes behind the scenes of the digest loop, and teaches both manual and automatic data binding approaches. Plus, learn how to integrate external libraries, diagnose performance issues, and debug your applications.
- $scope and controllers
- $scope built-in variables and methods
- $scope prototype inheritance
- Manual data binding with $scope.$watch
- The digest loop
- Get the $scope in the console
- Forcing $digest
Skill Level Advanced
AngularJS 1: Building a Data-Driven Appwith Ray Villalobos2h 15m Intermediate
1. Scope Basics
2. Manual Data Bindings
3. The Digest Loop
4. Tips for Debugging Angular in the Console
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.