I stumbled upon this code snippet on this website
import {Http} from 'angular2/http'
import {Injectable} from 'angular2/core'
@Injectable()
export class AddressBookService {
http:Http;
constructor(http:Http){
console.log('Creating AddressBookService');
this.http = http;
}
getEntries(){
return this.http.get('./people.json').map(res => res.json());
}
}
I'm struggling to grasp the purpose of res => res.json()
. It appears to be a lambda function, but I can't decipher its intended use. It doesn't seem to store a variable or perform any meaningful operations.
If someone could shed some light on what this line accomplishes, it would be greatly appreciated.