angular.forEach obj parameter in callback function (#14953)

This commit is contained in:
Jakub
2017-03-10 07:28:42 +01:00
committed by Mohamed Hegazy
parent c12c733253
commit 2efe76ecf0
2 changed files with 5 additions and 4 deletions

View File

@@ -587,7 +587,8 @@ namespace TestPromise {
function test_angular_forEach() {
const values: { [key: string]: string } = { name: 'misko', gender: 'male' };
const log: string[] = [];
angular.forEach(values, (value, key) => {
angular.forEach(values, (value, key, obj) => {
obj[key] = value;
this.push(key + ': ' + value);
}, log);
// expect(log).toEqual(['name: misko', 'gender: male']);