Created
April 24, 2017 22:21
-
-
Save JudahGabriel/1293a8be3bc508437b4c25be66dfab01 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
class UsersController { | |
users: User[] = []; | |
constructor() { | |
this.fetchUsers(); | |
} | |
async fetchUsers() { | |
var result = await this.$http.get("/users/all"); // Put this in a service, obviously. userService.get() or whatever. | |
this.users = result; // Yay! The UI will automatically update to show these users. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment