Skip to content

Conversation

@kingcody
Copy link
Member

Changes:

  • use User.query() in admin.controller instead of $http

@kingcody
Copy link
Member Author

@DaftMonk I noticed you mentioned the use of the canary branch for 'larger' features. Should PR's be made to that branch currently or did you want to wait till a particular time?

@meeDamian
Copy link
Contributor

Great point!

It should work the same even if you remove your changes to user.service.{js,coffee} files, and use $scope.users = User.get() instead :).

I think master is suitable for that change.

@kingcody
Copy link
Member Author

@chester1000, you're partly correct? The endpoint /api/user returns an array. Wouldn't the User.get() method be configured to have isArray: true? I'm pretty sure angular errors when it is not set. However other endpoints such as /api/user/me return {} so the .get() method works for those.
Please correct me if I'm wrong. Thanks

@meeDamian
Copy link
Contributor

Oups, I meant query.

[...] Use $scope.users = User.query() instead :).

@kingcody
Copy link
Member Author

ah, indeed. I shall revise.

…he admin page

Changes:
- use User.query() in admin.controller instead of $http
@kingcody
Copy link
Member Author

@chester1000 thanks. Silly me too, I definitely knew $resource.query(). Duh ;)

DaftMonk added a commit that referenced this pull request Jul 31, 2014
feat(user-management): use the User $resource to populate users for the admin page
@DaftMonk DaftMonk merged commit 96907e3 into angular-fullstack:master Jul 31, 2014
@kingcody kingcody deleted the feature/user-mng-uses-resource branch August 13, 2014 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants