Added empty templates for list page and panel #128#137
Added empty templates for list page and panel #128#137jardix22 wants to merge 7 commits intorecidive:masterfrom
Conversation
There was a problem hiding this comment.
You can use ng-show="!items.length" instead of ng-if="items.$empty". This doesn't require changing the controller.
There was a problem hiding this comment.
Please remove "list-group-item" class and change "no-items" to "empty".
There was a problem hiding this comment.
I don't think "items.length" will work. "items" is, indeed, a object mapping "[id] => [object item]" and therefore it has no "length" property. Also, "items" has other properties with names that start with "$" (like "$promise"), what is automatically ignore by angular on ng-repeats, so you can see it is not really a common object.
There was a problem hiding this comment.
@recidive ng-show="!items.length" doesn't work, i tested this and @lucasconstantino have reason.
There was a problem hiding this comment.
You're right, I was searching for a workaround for this and thought briefly we were working with arrays.
I feel this search for "$" a little fragile, was wondering if we could use some AngularJS API method for lopping through this, or maybe a lodash one?
|
Hello @jardix22, great patch. I've added some line notes. It looks like the change in the controller is not really necessary. Please make the changes and update the pull request, then I'll review it and merge it in ASAP. Thanks! |
There was a problem hiding this comment.
Maybe you could use $scope.items.hasOwnProperty(key); for checking if the property is local or inherited.
…tions/choko into fs/empty-template-for-list Conflicts: applications/default/public/js/controllers.js applications/default/public/templates/list-group.html
No description provided.