Fixed example
This commit is contained in:
parent
95a90b51fb
commit
838714aac1
9 changed files with 73 additions and 45 deletions
|
|
@ -1,10 +1,22 @@
|
|||
|
||||
var tpl = '<div><h2>Foo</h2><p>Welcome to the foo.</p></div>';
|
||||
tpl += '<input type=\"button\" class=\"btn btn-default\" ng-click=\"doReboot()\" value=\"Reboot\"></input>';
|
||||
tpl += '<input type=\"button\" class=\"btn btn-default\" ng-click=\"doClearServer()\" value=\"Clear Server\"></input>';
|
||||
|
||||
pageRouteInit.push(function ($routeProvider, $locationProvider) {
|
||||
$routeProvider.when('/example-ui/foo', {
|
||||
template: '<div><h2>Foo</h2><p>Welcome to the foo.</p></div>',
|
||||
template: tpl,
|
||||
controller: PageFoo
|
||||
});
|
||||
});
|
||||
|
||||
function PageFoo($scope, $http) {
|
||||
function PageFoo($scope) {
|
||||
$scope.doReboot = function ( path ) {
|
||||
window.location.reload(true);
|
||||
};
|
||||
|
||||
$scope.doClearServer = function ( path ) {
|
||||
FFSpaLoader.clearServer();
|
||||
window.location.reload(true);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,18 +5,23 @@ var serverUrl = window.FFServerUrl;
|
|||
console.log('FF provided serverUrl: '+serverUrl);
|
||||
|
||||
$(document.createElement('div')).attr('id', 'wrapper').appendTo($('body'));
|
||||
$(document.createElement('div')).attr('ng-include', '\''+serverUrl+'/example-ui/thtml/header\'').appendTo($('#wrapper'));
|
||||
$(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 = [];
|
||||
angular.module('exampleUI', ['ngRoute']).config(
|
||||
['$routeProvider', '$locationProvider', function
|
||||
($routeProvider, $locationProvider) {
|
||||
|
||||
pageRouteInit.forEach(function(init) { init($routeProvider, $locationProvider); });
|
||||
$routeProvider.otherwise({ redirectTo: '/example-ui' });
|
||||
$locationProvider.html5Mode({enabled: true, requireBase: false});
|
||||
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 );
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue