lib/puppet-herald/public/app.js in puppet-herald-0.1.1 vs lib/puppet-herald/public/app.js in puppet-herald-0.2.0

- old
+ new

@@ -1,10 +1,11 @@ (function(){ 'use strict'; var app = angular.module('herald' , [ 'ngRoute', + 'herald.page', 'herald.nodes', 'herald.node', 'herald.report', 'herald.filters', 'herald.artifact' @@ -12,16 +13,16 @@ app.config(['$routeProvider', function($routeProvider) { $routeProvider.otherwise({redirectTo: '/nodes'}); }]); - app.factory('appService', function() { - return { - page: 'home' - }; - }); - - app.controller('AppController', ['appService', function(appService) { - this.page = appService.page; + app.controller('AppController', ['Page', '$rootScope', function(Page, $rootScope) { + var ctrl = this; + this.page = null; + this.target = null; + $rootScope.$on('Page::titleChanged', function(event, title, target) { + ctrl.page = title; + ctrl.target = target; + }); }]); })(); \ No newline at end of file