Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ngOnInit() {
- this.data = this.apollo.query({ query: ResidentQuery }).subscribe(({data, loading}) => {
- this.data = data;
- this.loading = loading;
- });
- if (!this.loading) {
- // using this.data
- }
- }
- componentWillReceiveProps(newProps){
- if(!newProps.query.loading){
- this.setState({data: newProps.query.data})
- }
- }
Add Comment
Please, Sign In to add comment