﻿class Dictionary {
    constructor() {

    }

    static getFictionaryByTypeAndQuerySearch(dictionaryType, queryUrl, tagName) {
        var opts = {
            method: 'GET',
            headers: {}
        };
        var requestUrl = '/Dictionary/GetDictionaryForFilterSearchAdvanceItemStringFakeData?dictionaryType=' + dictionaryType + '&seacrhUrl=' + queryUrl;
        var tag = document.getElementById("tag" + tagName);
        //$.ajax({
        //    url: requestUrl,
        //    dataType: "JSON",
        //    type: "GET",
        //}).success(function (data) {

        //    data.ListDictionarys.forEach(el => {
        //        var node = document.createElement("li");
        //        node.innerHTML = "CLICK ME";
        //        tag.appendChild(node);
        //    });
        //});

        fetch(requestUrl, opts).then(function (response) {

            return response.json();
        }).then(function (json) {
            console.log(json);
            var node = document.createElement("li");
            node.innerHTML = json.StartTime;
            tag.appendChild(node);
            //json.ListDictionarys.forEach(el => {
            //    var node = document.createElement("li");
            //    node.innerHTML = el;
            //    tag.appendChild(node);
            //});
            //console.log(json.ListDictionarys);


            return json;
        });
        console.log(tag);
    }


}