How should modules interact in a MC* application

How should modules interact in a MC* application


How they shouldn’t: Slide 56,57 of

How they should: Slide 61 of


This is the way to do the slide 56 thing in Angular:

Create a svc. and inject in both the modules, 1 and 2

Code in Module 2: Service1.module2.proxy.function = myFunction

Code in Svc.: var module2 = {proxy : myfunction :{}}

Code in Module 1 when the event occurs, which it wants to propogate to Module 2: Service1.module2.proxy.function()

This is the way to do the slide 61 thing in Angular:

The Module 1 should Emit the event and the Application (underlying page that hosts all the modules)  should catch that event and Broadcast the event which will then be caught by Module 2



webAPI project deployment

A WebAPI project created using Visual Studio 2012 scaffolds a lot of junk code including a sample controller and Start and a Help page etc.

It also adds a lot of junk references of dlls and js files….

You may not want to deploy all this in production…

So make sure you clean it all up and also clean up unused ref. (rt. Clk on ref folder gives you this option)


Clean Up Default WebAPI MVC 4 Project

  1. Delete the Areas Folder
  2. Delete <package id=”Microsoft.AspNet.WebApi.HelpPage” version=”4.0.0″ targetFramework=”net45″ /> from packages.config
  3. Delete the Content folder
  4. As the contents of 3 are registered in BundleConfig.cs, remove from there.

MVC 4 WebAPI Tips and Tricks

  1. Session/Persistent Storage in WebAPI

Simply declare the Object as Static:


public class ValuesController : ApiController


//private readonly List itemsList = new List();

private static readonly List itemsList = new List();