Changes for upcoming Angular refactoring

Changes which will be necessary before https://github.com/angular/angular.js/pull/8430