以角度js

时间:2016-03-04 01:48:19

标签: angularjs spring-mvc

我是角度js的新手,目前我显示要查看的值,使用appviewbatch对象,我需要包含控件,例如带有唯一值的appviewbatch.odate列表框和带有唯一值的列表框appviewbatch.status,on从列表框中选择值我需要过滤并在表格视图中显示..

你能解释我怎么能这样做。

<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<html>
<head>
<script src="/LDODashBoard/js/scripts.js" language="JavaScript" type="text/javascript">
</script>

<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>

<link rel="stylesheet" type="text/css" href="/LDODashBoard/css/mystyle.css" /> 
<meta charset="utf-8">

</head>
<body>
<div align="center" style="color:white">

<table id="table1"><caption> <STRONG> AppView DisplayPage </STRONG> <br> <br> </caption>
    <tr>
        <td> JobName </td>
        <td> Description </td>
        <td> ODATE </td>
        <td> StartTime </td>        
        <td> EndTime </td>  
        <td> Status </td>   
        <td> RunDuration </td>  
        <td> CyclicJob </td>    
    </tr>

    <c:forEach items="${appviewbatch}" var="appview">
            <tr>
                <td> ${appview.jobName}</td>
                <td> ${appview.description}</td>
                <td> ${appview.oDATE}</td>
                <td> ${appview.startTime}</td>
                <td> ${appview.endTime}</td>
                <td> ${appview.status}</td>
                <td> ${appview.runDuration}</td>
                <td> ${appview.cyclicJob}</td>
            </tr>
    </c:forEach>

</table>

<br>
<c:url value="/L1OutputDisplayPage?gcmmLink2=true" var="messageUrl2" />
Click <a href="${messageUrl2}" style="color:yellow" onclick="doSomething('displayContent','/LDODashBoard/L1OutputDisplayPage?','gcmmLink2=true');return false;"> Here</a>
 to Close


</div>
</body>
</html>

1 个答案:

答案 0 :(得分:0)

在控制器中创建一个数组。您可以使用Angular的$ http服务从HTTP请求填充该数组。

在视图中,然后使用ng-repeat迭代数组中的项目/对象。

结帐https://docs.angularjs.org/api/ng/directive/ngRepeat#example