From http://stackoverflow.com/questions/17389291/angularjs-with-oop-inheritance-in-action