Skip to content

Instantly share code, notes, and snippets.

@etiennetalbot
Last active December 13, 2018 16:05
Show Gist options
  • Select an option

  • Save etiennetalbot/0a12712d9eb86ab858bb39b181a9ae52 to your computer and use it in GitHub Desktop.

Select an option

Save etiennetalbot/0a12712d9eb86ab858bb39b181a9ae52 to your computer and use it in GitHub Desktop.
Angular Resolver - Get data from resolver
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
@Component({
selector: 'pilots-list',
templateUrl: 'pilots-list.component.html',
})
export class PilotsListComponent implements OnInit {
pilotsList: [];
constructor(
private route: ActivatedRoute,
) {}
ngOnInit(): void {
this.pilotsList = this.route.snapshot.data.pilots;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment