-
-
Notifications
You must be signed in to change notification settings - Fork 598
Closed
Labels
type:docsOnly change in the docs or READMEOnly change in the docs or README
Description
Sorry firstly if this has been answered somewhere, but I cannot for the life of me figure out how to extend the Promise.User
object. Below is an example of what I'm trying to do"
Parse.User.allowCustomUserClass(true);
export class User extends Parse.User {
IsAdmin: boolean;
constructor() {
super('_User');
}
isThisUserAnAdmin(): boolean {
return !(!this.get('IsAdmin'));
}
static signUpAsAdmin(email: string, password: string): Promise<User> {
return Parse.User.signUp(email, password,
{
email: email,
isAdmin: true
}
);
}
}
Parse.Object.registerSubclass('User', User);
Obviously signUpAsAdmin
won't work as it will return an instance of Parse.User
and not User
, but I can't find any clear example of extending Parse.User
with an extra property in typescript (should I use typescript accessors?). Again, sorry if there is one, but my head is a bit buggered from looking. Cheers
Metadata
Metadata
Assignees
Labels
type:docsOnly change in the docs or READMEOnly change in the docs or README