0

I have strange issue, which is really hard to reproduce with `dotdotdot1 directive:

  .directive('dotdotdot', ['$timeout', function($timeout) {
    return {
      restrict: 'A',
      link: function(scope, element) {
        scope.$evalAsync(function () {
          element.dotdotdot({
            watch: true,
            wrap: 'letter'
          });
        });

        angular.element('.modal').on('shown.bs.modal', function() {
          angular.element('.modal-nonedit-dotdotdot').dotdotdot({
            watch: true,
            wrap: 'letter'
          });
        });
      }
    };
  }]);

but sometime it is called before get my scope variable from the server, so it behaviour is really strange...

and i have ideas that i must use timeout...

but how can i use it? becouse if i set

$timeout(function() {
      element.dotdotdot({
        watch: true,
        wrap: 'letter'
      });
    });

than it works in strange way too...

how could i set correctly executing of directive?

brabertaser19
  • 5,678
  • 16
  • 78
  • 184

0 Answers0