코드 사본은 다음과 같습니다.
<! doctype html>
<html>
<헤드>
<meta charset = "utf-8">
<title> 제목의 문서 </title>
</head>
<script src = "http : // localhost : 81/js/jquery.js">
</스크립트>
<script src = "http : // localhost : 81/js/angular.min.js">
</스크립트>
<body ng-app = "app"ng-controller = "c">
<div dir ng-repeat = "항목의 항목"ng-model = "m">
{{item}} + {{m}} <br>
</div>
</body>
<cript>
var app = angular.module ( "app", []);
함수 c ($ scope) {
$ SCOPE.ITEMS = [1,2,2,3,4,5,5];
$ scope.m = "String";
};
app.directive ( "dir", function ($ parse) {
반품 {
컴파일 : 함수 ($ compile) {
반환 함수 (s, e, a) {
//무엇 .. ..
//a.ngmodel
// $ ( "xxx"). scope.xx = model을 사용합니다
//양수인
//console.log ($ parse (a.ngmodel). Assign (S, "SDFS ____________________________________dfd"))))
SM = "SDFS ____ ____#@$#@$#@$#@$ __ dfd의 두 효과는 동일합니다.";
}
}
}
});
</스크립트>
</html>
위의 것은 AngularJS에서 $ SCOPE 메소드를 사용하는 가이드의 전체 내용입니다. 나는 당신이 그것을 좋아하기를 바랍니다.