other-countries.ctrl.js 1.27 KB
Newer Older
eddie.woo's avatar
eddie.woo committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
analysisModule.controller('OtherCountriesController', ['$scope','$filter', '$log', '$translate', '$http','SweetAlert',
    'apiConfig',
    function ($scope,$filter, $log, $translate, $http,SweetAlert,apiConfig) {
        'use strict';

        function init() {
            $http.get('/tableau/otherCountries', apiConfig.createVat())
                .success(function (res) {
                    if (res && 0 === res.code) {
                        var placeholderDiv = document.getElementById('vizContainer');
                        var url = res.data;
                        var options = {
                            onFirstInteractive: function() {
                                // The viz is now ready and can be safely used.
                                console.log("Run this code when the viz has finished     loading.");
                            }
                        };
                        try{
                            new tableau.Viz(placeholderDiv, url, options);
                        }catch (e) {

                        }
                    }else {
                        SweetAlert.error($translate.instant('SystemError'));
                    }
                });
        }
        init();

        (function initialize() {

        })();
    }
]);