- ABP Framework version: v3.0.4
- UI type: Angular
How can I use @volo packages services like finding users in identityService in Angular?
I have a component that is linked to a user, exactly like the functionaly of adding members to Organization Units.
I do not want to recreate the whole FindUsers API client side, as you alreay have it in the NPM package.
3 Answer(s)
-
0
Hi,
Those services are exported from the
@volo/abp.ng.identity
package. You can import and use them in your app as follows:import { IdentityService, OrganizationUnitService } from '@volo/abp.ng.identity';
You do not have to (and actually should not) provide them in your module or your component metadata, because they are
providedIn: 'root'
.Please let me know if this answers your question.
Have a nice day.
-
0
Thanks,
an Example for getUsers(params?: ABP.PageQueryParams): Observable<Identity.UserResponse>;
would be helpful.
-
0
Hi,
Example usage:
import { IdentityService } from '@volo/abp.ng.identity'; @Component({ template: ` <pre><code>{{ usersResponse$ | async | json }}</code></pre> ` }) export class UsersComponent { usersResponse$ = this.identityService.getUsers({ maxResultCount: 10, sorting: 'surname asc' }); constructor(private identityService: IdentityService) {} }
Considering it is resolved, I am closing the issue.
I wish you a beautiful day.