title: How to refresh parameter returning by a function in Angular
body: <p>I am having problem on DevExtreme datasource and actually this question already sent to them and still being discussed. But I am wondering if I am missing something basic in Angular.</p>
  
  <p>DevExtreme introduce a AspNetData source control which makes communication with .NET API very easy. It accepts Options object where you can define additional parameters. In my scenario, I have defined "firmaId" loadParams which takes value via function.</p>
  
  <p>The function "getFirmaId()" simply returns "firmaId" variable.
  selectTab(e) function is being hit by clicking a tab controller. It gives a new value to "firmaId" succesfully. But when I load DataSource by using DevExtreme client API, loadParams of "firmaId" is always 0. Is it working as it is expected? In my opinion, this is contradicting functional programming concept of JavaScript.</p>
  
  <p>Any help appreciated.</p>
  
  <pre><code>firmaId: number;  
  
  constructor(private dataService: DataService) {  
  
      this.firmaId = 0;
  
      this.dataSource = AspNetData.createStore({  
        key: "id",  
        loadUrl: Constants.apiRoot + "/api/cari/get",  
        insertUrl: Constants.apiRoot + "/api/cari",  
        updateUrl: Constants.apiRoot + "/api/cari",  
        deleteUrl: Constants.apiRoot + "/api/cari",  
        loadParams:  { firmaId : this.getFirmaId() },  
        onBeforeSend: function(method, ajaxOptions) {  
            ajaxOptions.xhrFields = { withCredentials: true };  
        }  
      });  
    }  
  
    getFirmaId():number{  
      return this.firmaId;  
    }  
  
    selectTab(e) {  
  
      this.firmaId = e.itemData.id;  
      this.dataSource.load();  
  
    }
  </code></pre>