<!DOCTYPE html>
<html ng-app>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
</head>
<body>
Your name: <input type="text" ng-model="yourname" placeholder="World">
Hello {{yourname || 'World'}}!
<script src="http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js"></script>
</body>
</html>
本文转自 素颜猪 51CTO博客,原文链接:http://blog.51cto.com/suyanzhu/1895485