opal compatability as suggested in #2653

As suggested here https://github.com/angular/angular.js/issues/2653#issuecomment-20582266
See discussion in #2653

Any chance to get this integrated eventually?