Programming Hub
0 view | +0 today
Follow
Your new post is loading...
Your new post is loading...
Rescooped by Amit Kumar from JavaScript for Line of Business Applications
Scoop.it!

Mocking Server Dependencies in JavaScript and AngularJS

Mocking Server Dependencies in JavaScript and AngularJS | Programming Hub | Scoop.it

Most Single Page Applications (SPA) written in HTML and JavaScript interact with server side code using the familar XMLHttpRequest object. During development it can be convenient to run the application with mock data that eliminates this server dependency. This can be useful if the server side stack is complex and not easy to set up on a local machine or if a shared dev server running the server components suddenly goes offline. It’s also handy for tweaking the data returned by the services to ensure the UI behaves appropriately in specific scenarios. Naturally it’s imperative to integrate the SPA with real server code early and often but the flexibility provided by the “server mock” technique can be indispensible.

Note: while this article will illustrate how to mock services in an AngularJS application, this pattern applies to any UI technology (JavaScript or otherwise). The key is achieving Separation of Concerns (SoC) that allows real services and mock services to be easily swapped.


Via Jan Hesse
more...
No comment yet.
Scooped by Amit Kumar
Scoop.it!

Asp.net Trick and Some Concept: How to check checkbox is checked or unchecked on button click in asp.net,c# using java script.

more...
No comment yet.