'use strict';

/* Directives */

angular.module('swiftBrowser.directives', []).
    directive('sbVersion', ['version', function(version) {
        return function(scope, elm, attrs) {
            elm.text(version);
        };
    }]).
    directive('sbFormatBytes', ['bytesFilter', function(bytesFilter) {
        return {
            restrict: 'AE',
            scope: {
                count: '=',
            },
            link: function (scope, element, attrs) {
                var formatted = bytesFilter(scope.count);
                var parts = formatted.split(' ');

                element.text(parts[0] + ' ');
                element.append($('<span>').addClass('unit').text(parts[1]));
            },
        };
    }]);

@@ -569,17 +569,16 @@
 t(' ');%0A
-%0A
         
@@ -589,29 +589,31 @@
     
-element.text(
+scope.number = 
 parts%5B0%5D
  + '
@@ -612,15 +612,8 @@
 s%5B0%5D
- + ' ')
 ;%0A  
@@ -630,65 +630,29 @@
     
-element.append($('%3Cspan%3E').addClass('unit').text(
+scope.unit = 
 parts%5B1%5D
 ));%0A
@@ -651,10 +651,8 @@
 s%5B1%5D
-))
 ;%0A  
@@ -656,32 +656,103 @@
 %0A            %7D,%0A
+            template: '%7B%7Bnumber%7D%7D %3Cspan class=%22unit%22%3E%7B%7Bunit%7D%7D%3C/span%3E',%0A
         %7D;%0A    %7D

Simplify sbFormatBytes by using template over jQuery