angularjs测试

来源:互联网 发布:纸带打孔编程 编辑:程序博客网 时间:2024/06/03 08:20
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>test</title><script src="angular.js"></script><script>arrays={arg1:"test", arg2:13, test:"test", http:"http", f:890}function func( test, arg2){}var str=func.toString();str=str.split('{')[0];str=str.match(/\(.*\)/)[0];  // => "/ \ ( . * \ ) /"str=str.replace(/\s+/g, '');str=str.substring(1, str.length-1);var arr=str.split(',');var args=[];for(var i=0; i<arr.length; i++){args[i] = arrays[arr[i]];}var mod=angular.module('app',[]);mod.controller('ctrl1', function($scope){$scope.data=args;});</script></head><body ng-app="app" ng-controller="ctrl1"><ul>    <li ng-repeat="d in data">        {{d}}        </li>    </ul></body></html>

原创粉丝点击