You must Sign In to post a response.
  • Category: ASP.NET

    Loading issue in web api and angular js


    When I try to display records in table using webapi and angularjs , page loading is slow in first time

    my code foe webapi

    private ExerciseEntities1 db = new ExerciseEntities1();

    // GET api/Employee
    public IQueryable<Employee> GetEmployees()
    return db.Employees;

    index page

    <style type="text/css">
    table, tr, td, th {
    border: 1px solid grey;
    border-collapse: collapse;

    <script src="~/Scripts/angular.min.js"></script>
    var App = angular.module("myApp", [])
    App.controller("myCtrl", function ($scope, $http) {
    function GetAll() {

    $http.get('/api/employee/').then(function (response) {
    $scope.Employee =
    }, function () {


    <div ng-app="myApp" ng-controller="myCtrl">
    <tr ng-repeat="item in Employee">





    code has no error.problem getting slow on loading first time

    how to solve this


  • #769657
    I think the mentioned code was very clear. please check what was other stuff you have in the default page.

    The default page is usually used to have 40% - 50% more scripts than other pages. So that is cause of it maybe. Because of other pages load at a good speed than its not an issue with IIS or any other. The scripts are causing this.

    very first time, when you load it used to take lot of time to download all the scripts and links mentioned in the page and cached. so, second time on-wards it wont take that much time
    and it takes half of the first request time.

    Try to checking all scripts once again. And delete any unused script it has and specify only the required scripts or links.

    B.Ramana Reddy

  • Sign In to post your comments