I am using web service and forms for a number of situations in my project. But now when I try to use same strategy the data is not provided by the provider function. It gives ‘null’ value always. But I can see the value in chrome web console.

page.ts (controller)

call function this.getYearMaster(); in constructor

my controller function is

  getYearMaster() {
    .then(data => {
      this.year = data;
      alert("hi: "+this.year);

my provider function is

public getYearMaster() {
    const obj = {wsname: 'YearMaster' };
    const myData = JSON.stringify(obj);
    return new Promise((resolve, reject) => {
        console.log('will call the web service');

        const url = '';, myData, { headers: new HttpHeaders(), responseType: 'json'})
        /*.map(res => {
          console.log('res1', res);             
          return res; // is this map needed, when it is returning the same value?
          res => {
            console.log('res2', res);   
          (err) => { 
            console.log('oops some error in Project Financial year selection'); 


But I get on 'null' value as response ..

please advise