I use the angular-route.min.js since I want to make a Singe web page application using the ng-view directive. Something that will add to the complexity immediately.
The script tags I put just beforethe end body tag, since i want to load the HTML first. Just to see if the Angular framework works I have put the following code:
<html ng-app> <head> </head> <body> <div> <input type="text" ng-model="data.message" /> <h1>{{ data.message }}</h1> </div> <script src="Scripts/angular.min.js"></script> </body> </html>
Notice the ng-app and the ng-model="data.message". Both directives will be used to indicate to the Angular java-script that the source should be treated by the angular framework.
If your browser shows : data.message in the screen something is not right. It should present you with an input box and retype everything you type into the box like so:
if it shows this:
.....somethings wrong. Either you did not add the ng-app tag, or it did not reference the javascripts files in the right way.
If it show the right screen that's it. you're off to a start in the wonderful Angular.Js world.
No comments:
Post a Comment