'use strict'; document.title = 'FF-Spa-Loader Example'; var serverUrl = window.FFServerUrl; console.log('FF provided serverUrl: '+serverUrl); $(document.createElement('div')).attr('id', 'wrapper').appendTo($('body')); $(document.createElement('div')).attr('ng-controller', 'ApplicationController').attr('ng-include', '\''+serverUrl+'/example-ui/thtml/header\'').appendTo($('#wrapper')); $(document.createElement('div')).attr('id', 'page-wrapper').appendTo($('#wrapper')); $(document.createElement('div')).attr('id', 'container-fluid').attr('ng-view', '').appendTo($('#page-wrapper')); $(document.createElement('div')).attr('ng-include', '\''+serverUrl+'/example-ui/thtml/footer\'').appendTo($('body')); var pageRouteInit = []; var exampleUI = angular.module('exampleUI', ['ngRoute']).config( ['$routeProvider','$locationProvider','$sceDelegateProvider', function ($routeProvider , $locationProvider , $sceDelegateProvider) { pageRouteInit.forEach(function(init) { init($routeProvider, $locationProvider); }); $sceDelegateProvider.resourceUrlWhitelist(['self',serverUrl+'/**']); $routeProvider.otherwise({ redirectTo: '/example-ui' }); $locationProvider.html5Mode({requireBase: false}); }]); exampleUI.controller('ApplicationController',function($scope,$http,$location) { $scope.goLink = function ( path ) { $location.path( path ); }; });