navbar.ts 793 B

123456789101112131415161718192021222324252627282930313233343536
  1. ///<reference path="../../../headers/common.d.ts" />
  2. import config from 'app/core/config';
  3. import _ from 'lodash';
  4. import $ from 'jquery';
  5. import coreModule from '../../core_module';
  6. export class NavbarCtrl {
  7. contextSrv: any;
  8. /** @ngInject */
  9. constructor(private $scope, contextSrv) {
  10. this.contextSrv = contextSrv;
  11. }
  12. }
  13. export function navbarDirective() {
  14. return {
  15. restrict: 'E',
  16. templateUrl: 'app/core/components/navbar/navbar.html',
  17. controller: NavbarCtrl,
  18. bindToController: true,
  19. controllerAs: 'ctrl',
  20. transclude: true,
  21. scope: {
  22. title: "@",
  23. titleUrl: "@",
  24. },
  25. link: function(scope, elem, attrs) {
  26. scope.icon = attrs.icon;
  27. scope.subnav = attrs.subnav;
  28. }
  29. };
  30. }
  31. coreModule.directive('navbar', navbarDirective);