zoukankan      html  css  js  c++  java
  • angular.js demo

    <!DOCTYPE html>
    <html>
    <head>
    	<title></title>
    	<script type="text/javascript" src="angular.min.js"></script>
    	<script type="text/javascript">
    		var app = angular.module("test",[]);
    		app.controller("zhangshan",function ($scope,$http) {
    			$scope.list  = [];
    			$scope.alert= function(ddd){
    				alert(ddd);
    				$http.get("/one.php")
    				.then(function (ret){
    					$scope.list = ret.data;
    					angular.forEach($scope.list,function(value,key){
    
    
    						alert(key+">>>"+value);
    						if(key=="ddd") {$scope.list[key]["class"]="fuck"}
    
    
    
    					});
    
    
    				})
    
    
    
    
    
    
    			}
    			$scope.bbb  = "aaaaaaaaaaaaaaaaaaaaa";
    			
    
    
    		})
    
    	</script>
    </head>
    <body ng-app="test">
    
    <input ng-model="aaa">
    <div >{{aaa}}</div>
    <div ng-controller="zhangshan">{{bbb}}
    <input ng-model="str"/>
    <button ng-click="alert(str)">click</button>
    
    {{list}}
    
    <ul>
    <li ng-repeat="(ccc,li) in list" class="1{{li['class']}}1">{{ccc}}---{{li}}</li>
    
    </ul>
    
    </div>
    </body>
    </html>
    

      

    <?php
    
    $aaa["rrr"] = "aa9999999999999999999999999999999999999999999999999999999999999998a";
    $aaa["ddd"] = "bbb";
    echo json_encode($aaa);
    

      

  • 相关阅读:
    类模板机制
    C和C++中const的区别
    bitset
    静态库or动态库?
    多态原理探究
    程序从编译到运行过程
    对象的内存模型
    重载、重写(覆盖)和隐藏
    对继承和派生的理解
    对C++对象的理解
  • 原文地址:https://www.cnblogs.com/aliblogs/p/6417269.html
Copyright © 2011-2022 走看看