Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Component } from '@angular/core';
- import { BlogService } from '../../../services/blog.service';
- import { GobalConstants } from 'src/app/gobal-constants';
- @Component({
- selector: 'app-homelateral',
- templateUrl: './homelateral.component.html',
- styleUrls: ['./homelateral.component.css']
- })
- export class HomelateralComponent {
- recientes: any[] = [];
- url = GobalConstants.urlServer;
- isPromiseResolved: any;
- configCountry: any;
- constructor ( private blogService: BlogService){
- console.log("cargar vic")
- }
- ngOnInit(){
- /* this.blogService.getPromise().then(() => {
- this.Afterpromise();
- }); */
- this.blogService.getConfigCountry().subscribe(configCountry => {
- this.configCountry = configCountry;
- this.Afterpromise();
- console.log('Info actualizada:', this.configCountry);
- });
- this.blogService.getRecientes()
- .subscribe((resp) => {
- if(resp){
- this.recientes = resp;
- }else{
- alert("Es un error");
- }
- })
- }
- Afterpromise(): void {
- console.log('Depues de la consulta');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment