title: auto refresh of page in angularjs
body: <p>I am trying to refresh the page based on value selected. Initially i had set the meta tag to refresh the page for 10 secs. Later when a particular value is selected from combo, the page should get refreshed based on the value selected.
  There is a buildchart function which gets executed when i load the page or when refreshed. This function gets a json file from a location. The json file gets updated every few minutes. So after few intervals i will be getting the updated json file in a configured location . So i am configuring a combo box with values so that when the user selects the value, after that much secs  the json is fetched and the report displayed.</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;meta id="refresh" http-equiv="refresh" content="10;URL=/index.html#/Refresh"&gt;
  </code></pre>
  
  <p>Later in the code:</p>
  
  <pre><code>    &lt;select style="text-align: right;"  name="refreshrate" 
  ng-model="model.refreshrate" 
  ng-options= "item.value as item.label  for item in refreshValues "  
  ng-change = "TimedRefresh(model.refreshrate)"&gt;
  
   &lt;/select&gt;
  </code></pre>
  
  <p>My angular code</p>
  
  <pre><code>$scope.refreshValues =
              [
              {label:"1 Min", value:"1"},
              {label:"3 Min", value:"3"},
              {label:"5 Min", value:"5"},
              {label:"Never", value:"0"}
          ];
  
          $scope.TimedRefresh = function(t) {
                  console.log(t);
                  setTimeout("location.reload(true);", t*60);
          }
  </code></pre>
  
  <p>However, the page refreshes with the already configured value of 10 in the meta tag's content. what am i missing to update this?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I tried changing the meta tag during runtime when the value is selected, now the page refresh happens but only once at the specified selected interval and not repeatedly after that.</p>
  
  <pre><code>$scope.TimedRefresh = function(t) {
              console.log(t);
          var s = document.getElementById('refresh');
  
           s.setAttribute("content", t*10 +";URL=index.html#/Refresh");
  
          console.log(s);
      }
  </code></pre>
  
  <p>I removed the content attribute from the meta tag and assigned it at runtime. However i am trying to refresh the page not once but every configured interval times. </p>