要想看到实际效果,可以先声明一些属性跟方法,否则是看不到,仔细往下看有例子的. function ShowObjProperty(Obj) { var PropertyList=''; var PropertyCount=0; for(i in Obj){ if(Obj.i !=null) PropertyList=PropertyList+i+'属性:'+Obj.i+'\r\n'; else PropertyList=PropertyList+i+'方法\r\n'; } alert(Prope
----------------------------------------------------------------------------------- 原文:https://www.sitepoint.com/practical-guide-angularjs-directives/ A practical guide to angularJS directives. Directives are the most important components of any Angu