Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70435

Ionic login form in login 3

$
0
0

@PRASANNAKUMAR wrote:

import { Component } from ‘@angular/core’;
import { NavController } from ‘ionic-angular’;
import { Http, Headers, RequestOptions } from ‘@angular/http’;

@Component({
selector: ‘page-home’,
templateUrl: ‘home.html’
})
export class HomePage {

constructor(public http: Http) {

}

public login() {

var headers = new Headers();
headers.append("Accept", 'application/json');
headers.append('Content-Type', 'application/json' );
let options = new RequestOptions({ headers: headers });

let postParams = {

  UserName:"",
  Password:""
  
}

this.http.post("API_URL", postParams, options)
  .subscribe(data => {
    console.log(data['_body']);
   }, error => {
    console.log(error);// Error getting the data
  });

}

}

I want to declare a parameters dynamically can you any one help me. In this code i have successfully assign with api. But i want to declare the Parameters Dynamically

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70435

Trending Articles