国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

angularJS 中$scope方法使用指南

2019-11-20 13:11:52
字體:
來源:轉載
供稿:網友

復制代碼 代碼如下:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>無標題文檔</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="item in items" ng-model="m">
        {{item}} + {{m}} <br>
    </div>
</body>
<script>
var app = angular.module("app", []);
function c($scope){
    $scope.items = [1,2,2,3,4,5,5];
    $scope.m = "string";
};
app.directive("dir",function($parse){
    return {
        compile : function( $compile ){
            return function(s,e,a){
                //what   ..             ..
                //a.ngModel
                //用$("xxx").scope.xx = model
                //assign 分配
                //console.log( $parse( a.ngModel ).assign(s,"sdfs__________newValue__________dfd") )
                s.m = "sdfs____#@$#@$#@$@#$__dfd這兩個效果一摸一樣";
            }
        }
    }
});
</script>
</html>

以上就是關于angularJS 中$scope方法使用指南的全部內容了,希望大家能夠喜歡。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 沅陵县| 清流县| 车致| 永平县| 乌兰浩特市| 阿荣旗| 白水县| 句容市| 银川市| 突泉县| 榕江县| 岳阳市| 吉水县| 锡林郭勒盟| 龙江县| 黄龙县| 逊克县| 噶尔县| 岫岩| 桐城市| 西吉县| 济阳县| 独山县| 福泉市| 天峨县| 横山县| 永胜县| 沿河| 阿克陶县| 伊金霍洛旗| 鄂托克旗| 临城县| 壤塘县| 东山县| 汾阳市| 龙山县| 余姚市| 龙游县| 炉霍县| 新建县| 保亭|