<!DOCTYPE html><html lang="en" ng-app><head> ???<meta charset="UTF-8"> ???<title>Title</title> ???<title>Title</title> ???<script type="text/javascript" src="./angular.js"></script></head><body> <input type="text" ng-model="userName"/> <div>您输入的内容是:<span>{{userName}}</span></div></body></html>
<!DOCTYPE html><html lang="en"><head> ???<meta charset="UTF-8"> ???<title>Title</title> ???<title>Title</title> ???<script type="text/javascript" src="./jquery-2.2.3.min.js"></script> ???<script type="text/javascript"> ????$(function(){ ????????$("input:text").keyup(function(){ ??????????$("span").html($(this).val()); ????????}); ????}); ?????????</script></head><body> <input type="text"/> <div>您输入的内容是:<span></span></div></body></html>
对比上面两个页面实现同样功能,让你开始对angularjs产生兴趣。。。。。。
AngularJS 启程
原文地址:https://www.cnblogs.com/Frank99/p/9048938.html