export class ChartsService {
    constructor($http, SessionService) {
        this.$http = $http;
        this.SessionService = SessionService;
    }

    getHistQuotes(opt) {
        return this.SessionService.isLogged().then(credentials => {
            const instrument = opt && opt.instrument || "EUR_USD",
                granularity = opt && opt.granularity || "M5",
                count = opt && opt.count || 251,
                dailyAlignment = opt && opt.dailyAlignment || "0";

            return this.$http.post("/api/candles", {
                environment: credentials.environment,
                token: credentials.token,
                instrument,
                granularity,
                count,
                dailyAlignment
            }).then(candles => candles.data)
            .catch(err => err.data);
        });
    }
}
ChartsService.$inject = ["$http", "SessionService"];

@@ -166,13 +166,8 @@
 tes(
-opt) 
 %7B%0A  
@@ -176,123 +176,24 @@
     
-return this.SessionService.isLogged().then(credentials =%3E %7B%0A            const instrument = opt && opt.instrument %7C%7C
+    instrument =
  %22EU
@@ -200,20 +200,16 @@
 R_USD%22,%0A
-    
         
@@ -229,45 +229,15 @@
 ty =
- opt && opt.granularity %7C%7C
  %22M5%22,%0A
-    
     
@@ -255,38 +255,14 @@
 nt =
- opt && opt.count %7C%7C
  251,%0A
-    
     
@@ -290,42 +290,95 @@
 t = 
-opt && opt.dailyAlignment %7C%7C %220%22;%0A
+%220%22%0A        %7D = %7B%7D) %7B%0A        return this.SessionService.isLogged().then(credentials =%3E
 %0A   
@@ -382,31 +382,24 @@
             
-return 
 this.$http.p
@@ -707,17 +707,16 @@
 rr.data)
-;
 %0A       
@@ -716,17 +716,16 @@
         
-%7D
 );%0A    %7D

use default parameters