-
-
diff --git a/app/topbar/topbar.js b/app/topbar/topbar.js
new file mode 100644
index 0000000..3cb029d
--- /dev/null
+++ b/app/topbar/topbar.js
@@ -0,0 +1,14 @@
+'use strict';
+
+angular.module('adagios.topbar', ['adagios.live'])
+
+ .controller('TopBarCtrl', ['$scope', '$http', 'GetProblems', function ($scope, $http, GetProblems) {
+ $scope.notifications = GetProblems;
+ }])
+
+ .directive('topbar', function () {
+ return {
+ restrict: 'E',
+ templateUrl: "topbar/topbar.html"
+ };
+ });
diff --git a/app/navbar/navbar_test.js b/app/topbar/topbar_test.js
similarity index 64%
rename from app/navbar/navbar_test.js
rename to app/topbar/topbar_test.js
index 7523696..d71e7c8 100644
--- a/app/navbar/navbar_test.js
+++ b/app/topbar/topbar_test.js
@@ -1,12 +1,12 @@
'use strict';
-describe('Navbar module', function () {
+describe('Topbar module', function () {
var $compile,
$rootScope,
$controller,
$httpBackend;
- beforeEach(module('adagios.navbar'));
+ beforeEach(module('adagios.topbar'));
beforeEach(inject(function (_$compile_, _$rootScope_, _$controller_, _$httpBackend_) {
$compile = _$compile_;
@@ -14,24 +14,24 @@ describe('Navbar module', function () {
$controller = _$controller_;
$httpBackend = _$httpBackend_;
- $httpBackend.expectGET('navbar/navbar.html').respond('
{{ notifications }}');
+ $httpBackend.expectGET('topbar/topbar.html').respond('
{{ notifications }}');
}));
- describe('NavBarCtrl', function () {
+ describe('TopBarCtrl', function () {
it('should be defined', function () {
var scope = $rootScope.$new(),
- navbar = $controller('NavBarCtrl', { $scope : scopeĀ });
+ topbar = $controller('TopBarCtrl', { $scope : scopeĀ });
- expect(navbar).toBeDefined();
+ expect(topbar).toBeDefined();
});
});
- describe('Navbar directive', function () {
+ describe('Topbar directive', function () {
it('should insert the number of warnings', function () {
- var element = $compile('
')($rootScope);
+ var element = $compile('
')($rootScope);
$httpBackend.flush();
$rootScope.notifications = 44;
$rootScope.$digest();