1. HelloWorld article
1.1 Environment
Download: angular-1.2.5min.js
1.2 Source code
<!DOCTYPE HTML><HTMLNg-app> <Head> <script src= "Angular-1.2.5.min.js"></script > </Head> <Body>Hello {{' World '}}! </Body><HTML
1.3 Running Results
2. Bidirectional data binding
2.1 Source Code
<!DOCTYPE HTML><HTMLNg-app> <Head> <Scriptsrc= "Angular-1.2.5.min.js"></Script> </Head> <Body>Your Name:<inputtype= "text" ng-model= "Yourname" placeholder= "World" > <HR>Hello {{yourname | | | ' World '}}! </Body><HTML
2.2 Running Results
2.3. Description
Text input directive <input ng-model= "yourname"/> Binding a model variable called Yourname
Double curly braces mark the YOURNAME model variable added to the greeting language book.
You do not need to register an event listener or add an event handler for the change application!
Now try entering your name in the input box, and the name you type will be immediately updated to appear in the greeting, which is Angularjs's two-way binding concept. any changes to the input box immediately react to the model variable (One Direction), and any changes to the model variable are immediately reflected in the greeting text (another direction)