How can we access the data that is outside the subscription in angular ? . I wanted to get and use the result outside.
user component ts
submit(): void {
const request = this.UserService
.getUser()
.subscribe((result) => {
this.permissions = result[0].permissions
});
//I need to access the data here , permissions should not be empty
console.log("this.permissions" , this.permissions)
}
Service
getUser(): Observable<User[]> {
return from(this.feathers.service('users').find<User>({ query : { identityId : 8895}}))
.pipe(
map((result) => result.data)
);
}