การคัดลอกรหัสมีดังนี้:
<! doctype html>
<html>
<head>
<meta charset = "utf-8">
<tite> เอกสารชื่อ UNT </title>
</head>
<script src = "http: // localhost: 81/js/jQuery.js">>
</script>
<script src = "http: // localhost: 81/js/angular.min.js">
</script>
<body ng-app = "app" ng-controller = "c">
<div dir ng-repeat = "รายการในรายการ" ng-model = "M">
{{item}} + {{m}} <br>
</div>
</body>
<script>
var app = angular.module ("app", []);
ฟังก์ชั่น C ($ scope) {
$ scope.items = [1,2,2,3,4,5,5,5];
$ scope.m = "สตริง";
-
app.directive ("dir", ฟังก์ชั่น ($ parse) {
กลับ {
คอมไพล์: ฟังก์ชั่น ($ compile) {
ฟังก์ชั่น return (s, e, a) {
//อะไร .. ..
//a.ngmodel
// ใช้ $ ("xxx"). prope.xx = รุ่น
//กำหนด
//console.log ($ parse (a.ngmodel) .assign (s, "sdfs __________ newValue___________________dfd")))))))))))))))))))))))
SM = "SDFS ____#@$#@$#@$#@$ __ เอฟเฟกต์สองของ DFD เหมือนกัน";
-
-
-
-
</script>
</html>
ข้างต้นเป็นเนื้อหาทั้งหมดของคู่มือในการใช้วิธี $ SCOPE ใน AngularJS ฉันหวังว่าคุณจะชอบมัน