Example #1
0
 activate(){
     var client = new HttpClient();
     var self = this;
     client.get("api/districts").then( response => {
         self.districts = response.content;
     })
 }
Example #2
0
 activate(params){
     this.name = params.name;
     var client = new HttpClient();
     var self = this;
     client.get("api/districts/" + params.name).then( response => {
         self.streets = response.content;
     })
 }
Example #3
0
File: app.js Project: sniezekjp/mp
  constructor() {
    this.message = 'Hello World!';

    let client = new HttpClient();

    client.get('data/visibility.json')
      .then(data => this.visibility = data.content.visibility);

    client.get('data/level.json')
      .then(data => this.level = data.content.level)
  }
Example #4
0
 this.observerLocator.getObserver(this, 'text').subscribe(function executeSearch(val){
     self.isSearching = true;
     self.results = [];
     client.get("api/search?q=" + val).then(response => {                
         setTimeout(function(){ 
             self.isSearching = false;
             self.results = response.content;
         }, 1000);                
     })
 });
 constructor(host, port = 3990, ssl = false, ident = "00") {
   this.api = new HttpClient();
   this.host = host;
   this.port = port;
   this.ssl = ssl;
   this.ident = ident;
   this.api.configure(api => {
     let baseUrl = (this.ssl ? "https://" : "http://") + this.host + ":" + this.port + "/json";
     api.withBaseUrl(baseUrl);
   });
 }
 return this.status().then(status => {
   if (!status.challenge) {
     throw new Error("Cannot find a challenge");
   } else if (status.clientState === ChilliController.stateCodes.AUTH) {
     throw new Error("Current clientState is already %d", ChilliController.stateCodes.AUTH);
   }
   if (this.uamservice && protocol === "chap") {
     throw new Error("Not supported yet: uamservice");
   } else {
     let payload = {
       username: username
     };
     if (protocol === "chap") {
       payload.response = chap(this.ident, password, status.challenge);
     } else {
       payload.password = password;
     }
     return this.api.createRequest("logon").asGet().asJsonp(ChilliController.JSONP_CALLBACK).withParams(payload).send().then(success => success.content);
   }
 });
 status() {
   return this.api.jsonp("status", ChilliController.JSONP_CALLBACK).then(success => success.content);
 }
Example #8
0
File: app.js Project: titte/vbdemo
 activate() {
     this.http = new HttpClient();
     return this.http.get("api/bookings").then(response => {
         this.message = response.content;
     });
 }