Skip to content

Instantly share code, notes, and snippets.

Last active September 4, 2015 20:44
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
ADF shared data
<p>Dashboard framework with Angular.js and Twitter Bootstrap.</p>
<ng-include src="" />
<p>The easiest way to share and manage your Git, Mercurial and Subversion repositories over http.</p>
<li ng-repeat="page in vm.pages">
<a href="" ng-click="vm.setPage(page.href)">
angular.module('adf.shared.widgets', ['adf.provider'])
.config(function($logProvider, dashboardProvider){
// enable debug logging
// register widgets
.widget('toc', {
title: 'Table of contents',
description: 'Displays table of contents',
templateUrl: 'toc.html',
controller: 'tocController',
controllerAs: 'vm'
.widget('content', {
title: 'Display content',
description: 'Displays content',
templateUrl: 'content.html',
controller: 'contentController',
controllerAs: 'vm'
.service('contentService', function(){
var currentPage = "adf";
return {
page: function(page){
if (page){
currentPage = page;
return currentPage;
.controller('contentController', function($scope, $log, contentService){
var vm = this; = createPageUri(;
// watch for page changes
}, function(newValue, oldValue){
if (newValue !== oldValue){ = createPageUri(newValue);
$log.debug('switch page to ' +;
function createPageUri(page){
return page + '.html';
.controller('tocController', function($log, contentService){
this.pages = [{
name: 'angular-dashboard-framework',
href: 'adf'
name: 'SCM-Manager',
href: 'scm'
this.setPage = function(page){
$log.debug('set page to ' + page);;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment