Left file: appwork-v1_5_2/angular-starter/src/app/app.service.ts  
Right file: appwork-v1_6_0/angular-starter/src/app/app.service.ts  
1 import { Injectable } from '@angular/core'; = 1 import { Injectable } from '@angular/core';
2 import { Title } from '@angular/platform-browser';   2 import { Title } from '@angular/platform-browser';
3     3  
4 @Injectable()   4 @Injectable()
5 export class AppService {   5 export class AppService {
6   constructor(private titleService: Title) {}   6   constructor(private titleService: Title) {}
7     7  
8   // Set page title   8   // Set page title
9   set pageTitle(value: string) {   9   set pageTitle(value: string) {
10     this.titleService.setTitle(`${value} - Angular Starter`);   10     this.titleService.setTitle(`${value} - Angular Starter`);
11   }   11   }
12     12  
13   // Check for RTL layout   13   // Check for RTL layout
14   get isRTL() { <> 14   get isRTL(): boolean {
15     return document.documentElement.getAttribute('dir') === 'rtl' || = 15     return document.documentElement.getAttribute('dir') === 'rtl' ||
16            document.body.getAttribute('dir') === 'rtl'; <> 16       document.body.getAttribute('dir') === 'rtl';
17   } = 17   }
18     18  
19   // Check if IE10   19   // Check if IE10
20   get isIE10() { <> 20   get isIE10(): boolean {
21     return (document as any).documentMode === 10; = 21     return (document as any).documentMode === 10;
22   }   22   }
23     23  
24   // Layout navbar color   24   // Layout navbar color
25   get layoutNavbarBg() { <> 25   get layoutNavbarBg(): string {
26     return 'navbar-theme'; = 26     return 'navbar-theme';
27   }   27   }
28     28  
29   // Layout sidenav color   29   // Layout sidenav color
30   get layoutSidenavBg() { <> 30   get layoutSidenavBg(): string {
31     return 'sidenav-theme'; = 31     return 'sidenav-theme';
32   }   32   }
33     33  
34   // Layout footer color   34   // Layout footer color
35   get layoutFooterBg() { <> 35   get layoutFooterBg(): string {
36     return 'footer-theme'; = 36     return 'footer-theme';
37   }   37   }
38     38  
39   // Animate scrollTop   39   // Animate scrollTop
40   scrollTop(to: number, duration: number, element = document.scrollingElement || document.documentElement) { <> 40   scrollTop(to: number, duration: number, element = document.scrollingElement || document.documentElement): void {
41     if (element.scrollTop === to) { return; } = 41     if (element.scrollTop === to) { return; }
42     const start = element.scrollTop;   42     const start = element.scrollTop;
43     const change = to - start;   43     const change = to - start;
44     const startDate = +new Date();   44     const startDate = +new Date();
45     45  
46     // t = current time; b = start value; c = change in value; d = duration   46     // t = current time; b = start value; c = change in value; d = duration
47     const easeInOutQuad = (t, b, c, d) => { <> 47     const easeInOutQuad = (t: number, b: number, c: number, d: number) => {
48       t /= d / 2; = 48       t /= d / 2;
49       if (t < 1) { return c / 2 * t * t + b; }   49       if (t < 1) { return c / 2 * t * t + b; }
50       t--;   50       t--;
51       return -c / 2 * (t * (t - 2) - 1) + b;   51       return -c / 2 * (t * (t - 2) - 1) + b;
52     };   52     };
53     53  
54     const animateScroll = () => {   54     const animateScroll = () => {
55       const currentDate = +new Date();   55       const currentDate = +new Date();
56       const currentTime = currentDate - startDate;   56       const currentTime = currentDate - startDate;
57       element.scrollTop = parseInt(easeInOutQuad(currentTime, start, change, duration), 10); <> 57       element.scrollTop = easeInOutQuad(currentTime, start, change, duration);
58       if (currentTime < duration) { = 58       if (currentTime < duration) {
59         requestAnimationFrame(animateScroll);   59         requestAnimationFrame(animateScroll);
60       } else {   60       } else {
61         element.scrollTop = to;   61         element.scrollTop = to;
62       }   62       }
63     };   63     };
64     64  
65     animateScroll();   65     animateScroll();
66   }   66   }
67 }   67 }