Q:

Please explain me some methods used in Ionic 2 (Angular 2)

I've found some Ionic 2 code here:
This code retrieves the data and parses it as JSON.  It looks like this:
posts: any; 
constructor( public http: Http ) {
  this.http.get( 'https://www.reddit.com/r/gifs/new/.json?limit=10' )
    .map( res => res.json() )
    .subscribe(
        data => {
            this.posts = data.data.children;
        }
    );
}

I don't understand two things here:

What's the res variable?  Where does it come from?  Is it some internal variable or something else? 
What is the meaning of subscribe method?  I guess it's for accessing the data which we will get, but why is it called subscribe? 
What is the meaning of the data variable?  Where did we get it? 

I have not seen this kind of syntax in web technologies :)

A:

res is response from the api url used in this.http.get
subscribe is available on all observables, in this case only when you subscribe that request is fired 
data is the result from .map function, which is json value of string sent by server

Read the documentation https://angular.io/docs/ts/latest/

A:

You may be able to understand it better if we convert this TypeScript code to plain Javascript:
this.http.get( 'https://www.reddit.com/r/gifs/new/.json?limit=10' )
.map(function(res){
    return res.json();
})
.subscribe(function(data){
    this.posts = data.data.children;
});

Basically, the shorthand "arrow" function (() => {} or parameter => return) are a shortcut for the more verbose anonymous (callback) functions which are usual in asynchronous Javascript code. 
As you can see, the res variable is a parameter passed to the callback function that .map receives (which is called everytime a response is received, before it's being sent to the .subscribe() method), and res means "response", which is basically the response object received as plain text (JSON) from the HTTP GET request, which has a .json() method that allows you convert JSON to an actual Javascript object/array. 
The subscribe() function is a method from an Observable (a custom class provided by the RxJs package), which is the type of object returned by .get() and then by .map().  It's like a Promise except that it can return a result more than one time.  The callback function you pass to the .subscribe() function receives data, which is what the .map() function returned, or simply, the parsed JSON of the HTTP response converted to a Javascript object/array, which you can start using right away.