Updated design pattern for AngularJS