src/aria/pageEngine/PageEngine.js
function (args) {
            if (!this._pageConfigHelper) {
                this.$callback(args.cb);
                return;
            }
            var pageConfig = args.pageConfig, cfg = pageConfig.pageComposition, pageId = pageConfig.pageId;
            this.$raiseEvent({
                name : "beforePageTransition",
                from : this.currentPageId,
                to : pageId
            });
            this.currentPageId = pageId;
            this._pageConfigs[pageId] = pageConfig;
            var pageRequest = args.pageRequest;
            pageRequest.url = pageConfig.url;
            pageRequest.pageId = pageConfig.pageId;
            pageRequest.title = pageConfig.title;

            var json = ariaUtilsJson;
            json.setValue(this._data, "pageData", cfg.pageData);
            json.setValue(this._data, "pageInfo", pageRequest);

            var cfgTemplate = {
                classpath : cfg.template,
                div : this._getContainer(!pageConfig.animation),
                moduleCtrl : this._rootModule
            };

            this._modulesInPage = [];
            // if the div does not change, let's dispose the previous template first
            if (cfgTemplate.div == this._getContainer() && this._isTemplateLoaded) {
                Aria.disposeTemplate(this._getContainer());
            }
            Aria.loadTemplate(cfgTemplate, {
                fn : this._afterTemplateLoaded,
                scope : this,
                args : {
                    pageConfig : pageConfig,
                    cb : args.cb,
                    div : cfgTemplate.div,
                    pageRequest : pageRequest
                }
            });
        }
function (args) {
            if (!this._pageConfigHelper) {
                this.$callback(args.cb);
                return;
            }
            var pageConfig = args.pageConfig, cfg = pageConfig.pageComposition, pageId = pageConfig.pageId;
            this.$raiseEvent({
                name : "beforePageTransition",
                from : this.currentPageId,
                to : pageId
            });
            this.currentPageId = pageId;
            this._pageConfigs[pageId] = pageConfig;
            var pageRequest = args.pageRequest;
            pageRequest.url = pageConfig.url;
            pageRequest.pageId = pageConfig.pageId;
            pageRequest.title = pageConfig.title;

            var json = ariaUtilsJson;
            json.setValue(this._data, "pageData", cfg.pageData);
            json.setValue(this._data, "pageInfo", pageRequest);

            var cfgTemplate = {
                classpath : cfg.template,
                div : this._getContainer(!pageConfig.animation),
                moduleCtrl : this._rootModule
            };

            this._modulesInPage = [];
            // if the div does not change, let's dispose the previous template first
            if (cfgTemplate.div == this._getContainer() && this._isTemplateLoaded) {
                Aria.disposeTemplate(this._getContainer());
            }
            Aria.loadTemplate(cfgTemplate, {
                fn : this._afterTemplateLoaded,
                scope : this,
                args : {
                    pageConfig : pageConfig,
                    cb : args.cb,
                    div : cfgTemplate.div,
                    pageRequest : pageRequest
                }
            });
        }
function ( args ) { if ( ! this . _pageConfigHelper ) { this . $callback ( args . cb ) ; return ; } var pageConfig = args . pageConfig , cfg = pageConfig . pageComposition , pageId = pageConfig . pageId ; this . $raiseEvent ( { name : "beforePageTransition" , from : this . currentPageId , to : pageId } ) ; this . currentPageId = pageId ; this . _pageConfigs [ pageId ] = pageConfig ; var pageRequest = args . pageRequest ; pageRequest . url = pageConfig . url ; pageRequest . pageId = pageConfig . pageId ; pageRequest . title = pageConfig . title ; var json = ariaUtilsJson ; json . setValue ( this . _data , "pageData" , cfg . pageData ) ; json . setValue ( this . _data , "pageInfo" , pageRequest ) ; var cfgTemplate = { classpath : cfg . template , div : this . _getContainer ( ! pageConfig . animation ) , moduleCtrl : this . _rootModule } ; this . _modulesInPage = [ ] ; // if the div does not change, let's dispose the previous template first if ( cfgTemplate . div == this . _getContainer ( ) && this . _isTemplateLoaded ) { Aria . disposeTemplate ( this . _getContainer ( ) ) ; } Aria . loadTemplate ( cfgTemplate , { fn : this . _afterTemplateLoaded , scope : this , args : { pageConfig : pageConfig , cb : args . cb , div : cfgTemplate . div , pageRequest : pageRequest } } ) ; }
Load the page page template in the DOM
@param {Object} args Contains the pageId and the callback
@protected
Load the page page template in the DOM