Sha256: e39c35e539a635da893885b315912b3a01deed3c8268b90d15027d17d800f107

Contents?: true

Size: 884 Bytes

Versions: 32

Compression:

Stored size: 884 Bytes

Contents

!(angular => {
  'use strict';

  class PageTitleManager {

    constructor(ApplicationTitle, $route) {
      this._defaultTitle = ApplicationTitle;
      this._$route = $route;
    }

    set title(t) {
      this._title = t;
    }

    get title() {
      if (Utils.stringHelpers.isPresent(this._title)) {
        return this._title;
      } else if(this._$route.current && Utils.stringHelpers.isPresent(this._$route.current.title)) {
        return this._$route.current.title;
      } else {
        return this._defaultTitle;
      }
    }

    onDestroy(scope) {
      let _this = this;
      scope.$on('$destroy', this.unset.bind(_this));
    }

    unset() {
      this.title = undefined;
    }
  }

  PageTitleManager.$inject = ['ApplicationTitle', '$route'];
  angular.module('alephServices.pageTitleManager', []).service('PageTitleManager', PageTitleManager);

}(angular));

Version data entries

32 entries across 16 versions & 1 rubygems

Version Path
aleph_analytics-0.4.9.pre.dev public/assets/angular/services/lib/page_title_manager.js-227f9ddb49d23bfa934bf216ef96ccbd.es6
aleph_analytics-0.4.9.pre.dev app/assets/javascripts/angular/services/lib/page_title_manager.js.es6
aleph_analytics-0.4.8 public/assets/angular/services/lib/page_title_manager.js-227f9ddb49d23bfa934bf216ef96ccbd.es6
aleph_analytics-0.4.8 app/assets/javascripts/angular/services/lib/page_title_manager.js.es6
aleph_analytics-0.4.7 app/assets/javascripts/angular/services/lib/page_title_manager.js.es6
aleph_analytics-0.4.7 public/assets/angular/services/lib/page_title_manager.js-227f9ddb49d23bfa934bf216ef96ccbd.es6
aleph_analytics-0.4.4 public/assets/angular/services/lib/page_title_manager.js-227f9ddb49d23bfa934bf216ef96ccbd.es6
aleph_analytics-0.4.4 app/assets/javascripts/angular/services/lib/page_title_manager.js.es6
aleph_analytics-0.4.2 public/assets/angular/services/lib/page_title_manager.js-227f9ddb49d23bfa934bf216ef96ccbd.es6
aleph_analytics-0.4.2 app/assets/javascripts/angular/services/lib/page_title_manager.js.es6
aleph_analytics-0.4.1 public/assets/angular/services/lib/page_title_manager.js-227f9ddb49d23bfa934bf216ef96ccbd.es6
aleph_analytics-0.4.1 app/assets/javascripts/angular/services/lib/page_title_manager.js.es6
aleph_analytics-0.3.0 public/assets/angular/services/lib/page_title_manager.js-227f9ddb49d23bfa934bf216ef96ccbd.es6
aleph_analytics-0.3.0 app/assets/javascripts/angular/services/lib/page_title_manager.js.es6
aleph_analytics-0.2.0 app/assets/javascripts/angular/services/lib/page_title_manager.js.es6
aleph_analytics-0.2.0 public/assets/angular/services/lib/page_title_manager.js-227f9ddb49d23bfa934bf216ef96ccbd.es6
aleph_analytics-0.1.0 public/assets/angular/services/lib/page_title_manager.js-227f9ddb49d23bfa934bf216ef96ccbd.es6
aleph_analytics-0.1.0 app/assets/javascripts/angular/services/lib/page_title_manager.js.es6
aleph_analytics-0.0.6 public/assets/angular/services/lib/page_title_manager.js-227f9ddb49d23bfa934bf216ef96ccbd.es6
aleph_analytics-0.0.6 app/assets/javascripts/angular/services/lib/page_title_manager.js.es6