SoFunction
Updated on 2025-04-10

Guide to using the $scope method in angularJS


<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Unt titled document</title>
</head>
<script src="http://localhost:81/js/">
</script>
<script src="http://localhost:81/js/">
</script>
<body ng-app="app" ng-controller="c">
    <div dir ng-repeat="item in items" ng-model="m">
        {{item}} + {{m}} <br>
    </div>
</body>
<script>
var app = ("app", []);
function c($scope){
    $ = [1,2,2,3,4,5,5];
    $ = "string";
};
("dir",function($parse){
    return {
        compile : function( $compile ){
            return function(s,e,a){
                //what   ..             ..
                //
//Use $("xxx"). = model
//assign
                //( $parse( ).assign(s,"sdfs__________newValue__________dfd") )
                = "sdfs____#@$#@$#@$@#$__dfdThese two effects are exactly the same";
            }
        }
    }
});
</script>
</html>