ng-model 指令

2023-06-15,,

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<title></title>

<link rel="stylesheet" href="">

</head>

<body>

<div ng-app="myApp" ng-controller="myCtrl">

姓名:<input type="text" ng-model="name">

</div>

</body>

<script src="http://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></script>

<script>

var app = angular.module("myApp",[]);

app.controller("myCtrl",function($scope){

$scope.name = "John Doe";

});

</script>

</html>

《ng-model 指令.doc》

下载本文的Word格式文档,以方便收藏与打印。