Master Web Design in Photoshop
- 11 (Registered)
Angular Expressions
Then, in the body tag, I’m going to create a big, bold H1 tag. I’m going to just bind this to a property called “hello.” Then I’m going to create an input field, and I’m going to set this to “ng-model = “hello”.”
The idea is when I change “hello” in the input field, it will change the value in the H1 tag. I’m doing this to show that the AngularJS application is indeed initializing and spinning up.
Let’s jump into the page. Let’s refresh this. There’s nothing in the input field now, so we are not seeing the H1 tag. As I start to type, you can see that it is updating in real-time. This is how you know the AngularJS application is indeed working.
Just to summarize, we have added in the AngularJS file, to our page, using the script tag. Then we instantiated the AngularJS application using ng-app.
Then we bound to a simple value using ng-model and the {{ binding syntax. You can see this living in the page. This is how you get AngularJS into your application.
This is the very first step when using AngularJS. Check out the other egghead videos to learn more advanced topics on AngularJS. Catch you next time.