代码下载:https://files.cnblogs.com/files/xiandedanteng/AngularJSAuthorRepeat.rar 代码: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html ng-app="notesApp"> <
if (result.success) { var obj = JSON.parse(result.data); var sltObj = document.getElementById("selUser"); //获取select对象 for (var i = 0; i < obj.length; i++) { var optionObj = document.createElement("option"); //创建option对象 optionObj.v
//自定义的类 model m = new model(); //取得类的Type实例 //Type t = typeof(model); //取得m的Type实例 Type t = m.GetType(); string className = t.Name +"\r\n"; //获取所有方法 System.Reflection.MethodInfo[] methods = t.GetMethods(); //获取所有成员 System.Reflection.MemberInfo[]
//自定义的类 model m = new model(); //取得类的Type实例 //Type t = typeof(model); //取得m的Type实例 Type t = m.GetType(); string className = t.Name +"\r\n"; //获取所有方法 System.Reflection.MethodInfo[] methods = t.GetMethods(); //获取所有成员 System.Reflecti
一个辅助对象,用于给属性排序 class KeyValue implements Comparable<KeyValue>{ String key; Object value; @Override public int compareTo(KeyValue another) { return this.key.compareTo(another.key); } } 两个函数: /** * get a series of object's properties * @param obj * @r
function getPropByPath(obj, path) { let tempObj = obj; path = path.replace(/\[(\w+)\]/g, '.$1'); path = path.replace(/^\./, ''); let keyArr = path.split('.'); let i = 0; for (let len = keyArr.length; i < len - 1; ++i) { let key = keyArr[i]; if (key i