%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/news/public/scripts/directives/
Upload File :
Create Path :
Current File : /var/www/html/news/public/scripts/directives/updateTitle.js

'use strict';

angular.module('directives')
    .directive('updateTitle', ['$rootScope', '$timeout',
        function ($rootScope, $timeout) {
            return {
                link: function (scope, element) {

                    var listener = function (event, toState) {

                        var title = 'News Portal';
                        if (toState && toState.pageTitle) {
                            title = 'News Portal - ' + toState.pageTitle;
                        }

                        $timeout(function () {
                            element.text(title);
                        }, 0, false);
                    };

                    $rootScope.$on('$stateChangeSuccess', listener);
                }
            };
        }
    ]);

Zerion Mini Shell 1.0