JS/Examples/SinglePage/app/scripts/app.js
function loadView(view) {

        $errorMessage.empty();
        var ctrl = loadCtrl(view);

        if (!ctrl)
            return;

        // Check if View Requires Authentication
        if (ctrl.requireADLogin && !authContext.getCachedUser()) {
            authContext.config.redirectUri = window.location.href;
            authContext.login();
            return;
        }

        // Load View HTML
        $.ajax({
            type: "GET",
            url: "views/" + view + '.html',
            dataType: "html",
        }).done(function (html) {

            // Show HTML Skeleton (Without Data)
            var $html = $(html);
            $html.find(".data-container").empty();
            $panel.html($html.html());
            ctrl.postProcess(html);

        }).fail(function () {
            $errorMessage.html('Error loading page.');
        }).always(function () {

        });
    }
function loadView(view) {

        $errorMessage.empty();
        var ctrl = loadCtrl(view);

        if (!ctrl)
            return;

        // Check if View Requires Authentication
        if (ctrl.requireADLogin && !authContext.getCachedUser()) {
            authContext.config.redirectUri = window.location.href;
            authContext.login();
            return;
        }

        // Load View HTML
        $.ajax({
            type: "GET",
            url: "views/" + view + '.html',
            dataType: "html",
        }).done(function (html) {

            // Show HTML Skeleton (Without Data)
            var $html = $(html);
            $html.find(".data-container").empty();
            $panel.html($html.html());
            ctrl.postProcess(html);

        }).fail(function () {
            $errorMessage.html('Error loading page.');
        }).always(function () {

        });
    }
function loadView ( view ) { $errorMessage . empty ( ) ; var ctrl = loadCtrl ( view ) ; if ( ! ctrl ) return ; // Check if View Requires Authentication if ( ctrl . requireADLogin && ! authContext . getCachedUser ( ) ) { authContext . config . redirectUri = window . location . href ; authContext . login ( ) ; return ; } // Load View HTML $ . ajax ( { type : "GET" , url : "views/" + view + '.html' , dataType : "html" , } ) . done ( function ( html ) { // Show HTML Skeleton (Without Data) var $html = $ ( html ) ; $html . find ( ".data-container" ) . empty ( ) ; $panel . html ( $html . html ( ) ) ; ctrl . postProcess ( html ) ; } ) . fail ( function ( ) { $errorMessage . html ( 'Error loading page.' ) ; } ) . always ( function ( ) { } ) ; }
Show a View
Show a View