Last active
September 14, 2022 18:31
-
-
Save Prajwalprakash3722/94f56b8a7b54cd5eb21779ada675d644 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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