I would like to get user and filter whether the given username exists. I have problem with property
'filter' does not exist on type 'Object'
TakeUsernameIfExist(user: User) {
return this.http.get(this.rootUrl + 'api/TakeUserName/' + user.UserName )
.delay(1000)
.map(users => users.filter( data => data === user.UserName))
.map(users => !users.length);
}
I added import for filter and the problem is still.
import 'rxjs/add/operator/filter'; My Web API method:
[HttpGet]
[AllowAnonymous]
[Route("api/TakeUserName/{username}")]
public string TakeUserName(string username)
{
var userStore = new UserStore<ApplicationUser>(new ApplicationDbContext());
var manager = new UserManager<ApplicationUser>(userStore);
var result = userStore.FindByNameAsync(username);
if(result==null)
{
return null;
}
else
{
return result.Result.UserName;
}
}
Any help or suggestion is welcome.
usersis an object.filteronly works inarray. see this developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/… - Harunur Rashidusers- Harunur Rashidusers? - Harunur Rashid