Adaptive templates for AngularJS