castillo-io / angular-css

CSS on-demand for AngularJS [Looking for New Maintainers]
http://castillo-io.github.io/angular-css/#/
MIT License
470 stars 86 forks source link

Error: [orderBy:notarray] Expected array but received: 0 #60

Closed caelum777 closed 8 years ago

caelum777 commented 8 years ago

Using Angular 1.5.0 and $routeProvider to inject the css like this:

.when('/profile/:memberId', { templateUrl: 'views/profile.html', controller: 'ProfileCtrl', css: { href: 'assets/css/profile.css', preload: true }, controllerAs: 'profile' })

Get an error that says: "Error: [orderBy:notarray] Expected array but received: 0"

rpedroni commented 8 years ago

Started getting this error when I migrated my code base into another project. Mine complains about orderBy:notarray instead.

jorgemarcondes commented 8 years ago

Same happens with me, please try to fix it.

maybe here: ngRepeat: stylesheet in stylesheets track by $index | orderBy: 'weight'

darleendenno commented 8 years ago

Same here! I double checked my dependencies and tried a few different ways of doing this, but still receive the same error. What's going on?

harmoniemand commented 8 years ago

as a workaround you could search for this line var template = '<link ng-repeat="stylesheet in stylesheets track by $index | orderBy: \'weight\' " rel="{{ stylesheet.rel }}" type="{{ stylesheet.type }}" ng-href="{{ stylesheet.href }}" ng-attr-media="{{ stylesheet.media }}">';

and remove the

| orderBy: \'weight\'

cwx0046 commented 8 years ago

Does anyone received this error after use angular-cookies? In a new project I didn't met this error at first, but add angular-cookies made this happen.

danielcaldas commented 8 years ago

Same thing here... Using Angular 1.5.0 and getting this: angular.js:13424 Error: [orderBy:notarray]

c-franklin commented 8 years ago

Also getting this error. Breaks the css every time we do a bower install.

Thank you harmoniemand - your fix does the job.

Remove:

| orderBy: \'weight\'

alexcastillo commented 8 years ago

Thank you for the feedback, everyone. I'm working on a fix.

alexcastillo commented 8 years ago

Fixed in v1.0.8

c-franklin commented 8 years ago

Thanks for the fix! Make sure to update the module name in app.js from door3.css to angularCSS if you haven't re-read the updated readme.md.

harmoniemand commented 8 years ago

May you should open a separate issue for this