Die Codekopie lautet wie folgt:
<! docType html>
<html>
<kopf>
<meta charset = "utf-8">
<title> bis zum Titel "Dokument" </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 = "Element in Elementen" ng-model = "m">
{{item}} + {{m}} <br>
</div>
</body>
<Script>
var app = angular.module ("app", []);
Funktion c ($ scope) {
$ scope.Items = [1,2,2,3,4,5,5];
$ scope.m = "String";
};
app.directive ("Dir", Funktion ($ parse) {
zurückkehren {
kompilieren: Funktion ($ compile) {
Rückgabefunktion (s, e, a) {
//Was .. ..
//a.ngmodel
// $ ("xxx"). Scope.xx = Modell verwenden
//zuordnen
//console.log ($ Parse (A.Ngmodel) .Sign (s, "SDFS __________ NewValue___________________DFD"))
sm = "SDFS ____#@$#$##$#@$ __ DFDs zwei Effekte sind die gleichen";
}
}
}
});
</script>
</html>
Das obige ist der gesamte Inhalt der Anleitung zur Verwendung der $ Scope -Methode in AngularJs. Ich hoffe es gefällt euch.