Create your first AngularJS application method, and the first angularjs
Follow these steps to create an AngularJS Application
Step 2: load the framework
As a pure JavaScript framework, it can be added using the <script> tag.
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>
Step 2: Use the ng-app command to define AngularJS applications
<div ng-app="">...</div>
Step 1: Use the mode name defined by the ng-model command
<p>Enter your Name: <input type="text" ng-model="name"></p>
Step 2: Use the ng-bind command to bind the values in the above model to the definition.
<p>Hello <span ng-bind="name"></span>!</p>
Follow these steps to run AngularJS applications
Use the three steps mentioned above to go To the HTML page.
TestAngularJS.html
<Html> <title> AngularJS First Application </title> <body>
Output
Open textangularjs.html in the webbrowser. Enter the name and the result.
How to integrate AngularJS with HTML
- The ng-app command indicates the beginning of the AngularJS application.
- The ng-model command creates a model variable named "name" on the HTML page, and the ng-app command is used in the div.
- Ng-bind the model name is displayed in the HTML span tag as long as what you enter in the text box.
- The end </div> flag indicates the end of The AngularJS application.