在javascript中,您可以使用点表示法或括号表示法引用对象的属性.这可以通过使用字符串变量来实现,例如:
var myObject = { hello: "world" };
var prop = "hello";
// both will output "world".
console.log( myObject[ prop ] );
console.log( myObject.hello );
Run Code Online (Sandbox Code Playgroud)
在java中是否有类似的语法来使用字符串变量访问对象属性,类似于javascript的括号表示法?
angularJS是否有任何基于ng-controller名称空间的外部JS/CSS文件延迟加载?以便以下将com.myApp.SomeClass.js和com.myApp.SomeClass.css附加到文档头?
<div ng-controller="com.myApp.SomeClass"></div>
Run Code Online (Sandbox Code Playgroud) javascript model-view-controller jquery templating angularjs