Based on CaryLandholt / AngularFun Sandbox