Ok, so I've been messing around with Angular.js, so far, a great framework for client-side HTML manipulation. Advantages include separation of concern (with an MVC architecture), and really good testing ease using Jasmine, taking advantage of Dependency injection, and awesome databinding features.
With regards to the Dependency injection, there is a $xhr service (it's a service used to GET data), but when I attempted to use it with IIS 7, no go. Checking IIS under the hood, I found no MIME mapping to .json files, so after some digging on the web, here is how to set it up:
Configure IIS to recognize JSON:
IIS7 configuration to support JSON:
Using IIS manager: clock on IIS server (the main node on the left - where you see the machine name)
- Add ‘json’ MIME Type
- Double click on ‘MIME Types’ icon
- Click ‘Add…’ link (under Actions section on the right side)
- In ‘Add MIME Type’ window type:
File name extension: .json
MIME type: application/json
- Click OK, You should see the .json MIME Type added to the list of the MIME Types list.
2. Add Script Map Handler for ‘json’ MIME Type
- Double click on ‘Handler Mappings’ icon
- Click on ‘Add Script Map…’ link (under Actions section on the right side)
- In ‘Add Script Map’ window type:
Request path: *.json
Executable: C:\Windows\System32\inetsrv\asp.dll
Name: JSON
- Click OK (Message box pops up with a message: Do you want to allow this ISAPI extension?...etc ) Click Yes, You should see the .json extension added to the list of the Handler Mappings list
Read more...