javascript - Angular variable not being show properly on webpage -
just title suggests, i'm trying self learn angular.js run unexpected frustrating road block... can't variables display on webpage!
<!doctype html> <html ng-app> <head> <title>lets test out?</title> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script> </head> <body> write name in text box! <input type="text" ng-model="sometext" /> <h1>hello {{ sometext }}</h1> </body> </html>
i'd appreciate can tell me doing wrong i've been beating head against desk hour , googled issue can't understand why doesn't work.
check angular reference has been loaded properly. try add ng-app body tag
demo
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script> <body ng-app> write name in text box! <input type="text" ng-model="sometext" /> <h1>hello {{ sometext }}</h1> </body>
Comments
Post a Comment