Skip to content

Instantly share code, notes, and snippets.

@Prajwalprakash3722
Last active September 14, 2022 18:31
Show Gist options
  • Save Prajwalprakash3722/94f56b8a7b54cd5eb21779ada675d644 to your computer and use it in GitHub Desktop.
Save Prajwalprakash3722/94f56b8a7b54cd5eb21779ada675d644 to your computer and use it in GitHub Desktop.
namespace Vehicle {
export class Bike {
user: User;
constructor(public inputUser: User) {
this.user = inputUser;
}
getName() {
return this.user.name;
}
}
}
const user: User = {
name: 'John Doe',
role: Role.OWNER
}
const bike = new Vehicle.Bike(user);
// we can also export the namespace itself.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment