Skip to content

Commit 799a566

Browse files
author
Alexander Castillo
committed
directive factory invoke issue
will open an issue to fix preload for directives
1 parent ac11050 commit 799a566

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

angular-css.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,8 @@
299299
if (!stylesheets) {
300300
stylesheets = [];
301301
// Add all stylesheets from custom directives to array
302-
if ($directives.length) Array.prototype.push.apply(stylesheets, $directives);
302+
// @TODO: preload directives once we can parse css on directive register
303+
//if ($directives.length) Array.prototype.push.apply(stylesheets, $directives);
303304
// Add all stylesheets from ngRoute to array
304305
if ($injector.has('$route')) Array.prototype.push.apply(stylesheets, $css.getFromRoutes($injector.get('$route').routes));
305306
// Add all stylesheets from UI Router to array
@@ -437,7 +438,7 @@
437438
module.directive = function(directiveName, directiveFactory) {
438439
var originalDirectiveFactory = angular.isFunction(directiveFactory) ?
439440
directiveFactory : directiveFactory[directiveFactory.length - 1];
440-
var directive = directiveFactory();
441+
var directive = {};
441442
directive.directiveName = directiveName;
442443
$directives.push(directive);
443444
return originalDirective.apply(this, arguments);

0 commit comments

Comments
 (0)