import template from './ws-secondary-nav.html';

SecondaryNavDirective.$inject = ['$translate'];

export default function SecondaryNavDirective($translate) {
  return {
    restrict: 'E',
    template,
    scope: {
      options: '=',
    },
    link(scope) {
      angular.forEach(scope.options, (option) => {
        if (option.stringId) {
          option.text = $translate.instant(option.stringId);
        }
      });
    },
  };
}
