我的目标是将值显示为从表格到 JSP 页面上模型弹出窗口的列表。
行动
public class IcdAction extends ActionSupport {
private List<Icd10> icdCodes;
public String execute() throws MalformedURLException, JsonProcessingException {
SomeProcess ap = new SomeProcess();
icdCodes = ap.getList();
return SUCCESS;
}
}
js
var myApp = angular.module('myApp', []);
myApp.controller('MainCtrl', function ($scope, $http) {
$http.get('IcdCodesAction')
.success(function(response){
$scope.icdcodes = response;
});
});
struts.xml
<action name="IcdCodesAction" class="com.emr.action.IcdAction" >
<result type="json">
</result>
</action>
在我使用的 JSP 文件ng-repeat
中icdcodes
。
我是 AngularJS 的新手。我无法弄清楚阻止显示列表的问题出在哪里。
如果我使用硬编码的 json 数据$scopes.icdcodes
,那么它工作正常。