when ever i search any locations using zip code from UI, iam using popup to 
show the user that backend search process is going on.For this i created 
one service to open and close popup.before search service searches 
locations, iam able to create popup. how ever when search is completed 
popup is not closing.Below is the code which iam using

import { Injectable,Component,OnInit,ViewChild, ElementRef,TemplateRef  } from 
'@angular/core';
import { BsModalService } from 'ngx-bootstrap/modal';
import { BsModalRef } from 'ngx-bootstrap/modal/modal-options.class';

@Injectable()
export class **LoadingIndicatorService** {

  bsModalRef: BsModalRef;  
  public config = {
       animated: true,
       keyboard: false,
       backdrop: "static",       
       ignoreBackdropClick: false
  };
  constructor(private modalService: BsModalService) { 
  }

  public openLoadingIndicator() {          
    this.bsModalRef = 
this.modalService.show(**LoadingIndicatorComponent**,Object.assign({}, 
this.config, {class: 'modal-sm'}));               
  }

  public closeLoadingIndicator(){
    this.bsModalRef.hide();
  }  

}

@Component({
  selector: 'loading-indicator-content',
  templateUrl: './loading-indicator.html',
  styleUrls: ['./loading-indicator.css']
})
export class **LoadingIndicatorComponent** implements OnInit{     
  ngOnInit() { }          
  constructor( private bsModalRef: BsModalRef,private modalService: 
BsModalService,private loadingIndicatorService: LoadingIndicatorService) {  
  }     
}

Iam calling **LoadingIndicatorService** from **SerachLocations Component**.When 
usee put any location in search box pop up comes and popup should close once 
search is completed but it is not happening.

SerachLocations Component{

 some method(){
 LoadingIndicatorService.openLoadingIndicator();//popup is opening fine here
 //serach locations service will be called here
 LoadingIndicatorService.closeLoadingIndicator();//popup should hide when 
search is done but it is not closing
 }
}

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to