Skip to content

Instantly share code, notes, and snippets.

@JudahGabriel
Created April 24, 2017 22:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JudahGabriel/1293a8be3bc508437b4c25be66dfab01 to your computer and use it in GitHub Desktop.
Save JudahGabriel/1293a8be3bc508437b4c25be66dfab01 to your computer and use it in GitHub Desktop.
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