added several tests from Angular. replaced _.extend with Angular version