数据绑定和第一个AngularJS 应用

Hello 小朋友

一:

<input ng-model="name" type="text" placeholder="Your Name">
<h1>Hello {{ name }}</h1>

 二:

<body ng-app="myApp">
    <div ng-controller="MyController">
        <h1>Hello {{ name }}</h1>
    </div>
<script> var myApp = angular.module('myApp',[]); myApp.controller("MyController",function($scope) { $scope.name = "小朋友"; }); </script> </body>
原文地址:https://www.cnblogs.com/vicii/p/6483210.html