Question: tried to display the name of the department that has the least student count.

Answer: 
I found the answer of my question. sure after lot and lots of google.

By default POST, PUT methods are not allowed in webAPI. You either need to use CORS package for that or another solution is (I used to fix my issue)...

Add below config in web.config

```
<system.webServer>
     <httpProtocol>
      <customHeaders>
        <add name="Access-Control-Allow-Origin" value="*" />
        <add name="Access-Control-Allow-Headers" value="Content-Type" />
        <add name="Access-Control-Allow-Methods" value="GET,POST,PUT,DELETE,OPTIONS" />
        <add name="Access-Control-Allow-Credentials" value="true" />
      </customHeaders>
    </httpProtocol>
  </system.webServer>

```

and you also need to flush your OPTIONS request. Add below code in Global.aspx file...

```
protected void Application_BeginRequest()
        {
            if (Request.Headers.AllKeys.Contains("Origin") && Request.HttpMethod == "OPTIONS")
            {
                Response.Flush();
            }
        }

```
remove one `$http` from the $inject 

```
UpdateEnvironmentController.$inject = ['$scope', '$http', '$rootScope'];

```

Also, add an empty square bracket to the module 

```
var webadmin = angular.module('PcPortal',[]);

```