In the angular 2 examples for pipe: https://angular.io/docs/ts/latest/guide/pipes.html there is an example of HeroBirthday2Component. I am not able to understand how this line works
get format() { return this.toggle ? 'shortDate' : 'fullDate'; }
I mean I understand that it toggles the format property and the DOM gets updated with the change detection after toggleFormat() changes it. But I am not able to grasp the line above. Could some one please explain the code line and its implementation.