GoalModelEditor/FrontEnd/public/js/dashboard.js
/**
 * Ajax function for retrieving all templates
 */
Ajax function for retrieving all templates
Ajax function for retrieving all templates
function retriveTemplates() {
    $.ajax(GET_TEMPLATE_URL, {
        type: "GET",
        headers: {Authorization: "Bearer " + TOKEN},
        success: templates => {
            for (let i in templates.templates) {
                let templateHTML = parseTemplate(templates.templates[i]);
                $("#templates-container").append(templateHTML);
            }
            removeCustomizedEventListeners();
            addListenersToNewItem();
        }
    }).fail(function(jqXHR) {
        warningMessageSlide(
            jqXHR.responseJSON.message + "<br>Please try again."
        );
    });
}
function retriveTemplates ( ) { $ . ajax ( GET_TEMPLATE_URL , { type : "GET" , headers : { Authorization : "Bearer " + TOKEN } , success : templates => { for ( let i in templates . templates ) { let templateHTML = parseTemplate ( templates . templates [ i ] ) ; $ ( "#templates-container" ) . append ( templateHTML ) ; } removeCustomizedEventListeners ( ) ; addListenersToNewItem ( ) ; } } ) . fail ( function ( jqXHR ) { warningMessageSlide ( jqXHR . responseJSON . message + "<br>Please try again." ) ; } ) ; }
Ajax function for retrieving all templates
Ajax function for retrieving all templates
// Append the projects to current UI // Add listeners