Building a Simple AngularJS Configuration Service

Monday, June 22, 2015

One of the things that I’m always being asked when I’m consulting about AngularJS is how to build a configuration service. The service requirements are to be able to load some configuration file and then to be able to use the configurations during runtime. This post will show you a simple AngularJS configuration service which can be a good starting point for your own implementation. Setting A Few Conventions Before we start writing the service, you should think about some conventions. For example, where is the location of the configuration file? What format to use? and so on. In my implementation the...
no comments

Avoiding Circular Reference for Entity in JSON Serialization

Monday, October 17, 2011

Avoiding Circular Reference for Entity in JSON Serialization One problem that I was facing yesterday while working on an ASP.NET MVC application was a JSON serialization issue. The problem was a circular reference caused by the DataContractJsonSerializer because of relations between the entity and other entities. In this post I’ll show you how you can use a simple workaround in order to avoid the problem.    The JSON Serialization Error Returning the output of the JSON method in an ASP.NET MVC controller with a JSON object graph based on an Entity Framework Code First object causes...