Skip to content

Commit

Permalink
directive factory invoke issue
Browse files Browse the repository at this point in the history
will open an issue to fix preload for directives
  • Loading branch information
Alexander Castillo committed Dec 29, 2014
1 parent ac11050 commit 799a566
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions angular-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,8 @@
if (!stylesheets) {
stylesheets = [];
// Add all stylesheets from custom directives to array
if ($directives.length) Array.prototype.push.apply(stylesheets, $directives);
// @TODO: preload directives once we can parse css on directive register
//if ($directives.length) Array.prototype.push.apply(stylesheets, $directives);
// Add all stylesheets from ngRoute to array
if ($injector.has('$route')) Array.prototype.push.apply(stylesheets, $css.getFromRoutes($injector.get('$route').routes));
// Add all stylesheets from UI Router to array
Expand Down Expand Up @@ -437,7 +438,7 @@
module.directive = function(directiveName, directiveFactory) {
var originalDirectiveFactory = angular.isFunction(directiveFactory) ?
directiveFactory : directiveFactory[directiveFactory.length - 1];
var directive = directiveFactory();
var directive = {};
directive.directiveName = directiveName;
$directives.push(directive);
return originalDirective.apply(this, arguments);
Expand Down

0 comments on commit 799a566

Please sign in to comment.