So I am very new to AngularJS and AJAX, but recently there is this task I receive and I have to do the VIEW of MVC framework using AngularJS/AJAX. But after looking through several links online, I couldn't find any resource that I want related to using AngularJS/AJAX in MVC framework.
So I have to do the CRUD in the controller and now I have done it and is able to present the data in the frontend, but I am not sure how to do the frontend in AngularJS/AJAX and presenting the data I retrieve from the controller. Is there any website or link that I can follow? Thanks alot
@model IEnumerable<WebApplication4.Models.PDAStatus>
@{
var result = (List<PDAStatus>)ViewData["MyData"];
}
<div class="row justify-content-center">
<div class="col-md-12">
<h2>View Outstanding PDA</h2>
<div class="panel">
<div class="panel-heading">
<div class="row">
<div class="col-md-12">
<a href="#" class="btn btn-sm btn-primary pull-left"><i class="fa fa-
plus-circle"></i>Add New</a>
</div>
</div>
</div>
<div class="panel-body table-responsive">
<div><table class="table">
<thead>
<tr>
<th scope="col">Action</th>
<th scope="col">Employee CardNo</th>
<th scope="col">Employee Name</th>
<th scope="col">PDA Barcode</th>
<th scope="col">Withdraw Date</th>
<th scope="col">Return Date</th>
<th scope="col">Due In</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
@if (item.IsReturn == false)
{
<tr>
<td>
<ul class="action-list">
<li><a asp-action="Update" asp-route-id="@item.Id"
class="btn btn-primary"><i class="fa fa-pencil"></i></a></li>
<li><a asp-action="Delete" asp-route-id="@item.Id"
class="btn btn-danger"><i class="fa fa-times"></i></a></li>
</ul>
</td>
<td>@item.EmployeeCardNo</td>
<td>@item.EmployeeName</td>
<td>@item.PDABarcode</td>
<td>@item.WithdrawDate</td>
<td>@item.ReturnDate</td>
<td>@(((int)(item.ReturnDate - DateTime.Now).TotalDays))
Days</td>
</tr>
}
}
</tbody>
</table></div>
</div>
</div>
</div>
</div>