title: New window in angularjs
body: <p>I have two html pages. <code>web.html</code> and <code>addroute.html</code>. They are made using bootstrap. The angularjs script has two controllers in it <code>webctrl</code> and <code>addctrl</code>. I have a button in <code>web.html</code>. When I click on button in <code>web.html</code> a new window opens <code>addroute.html</code> I need to change the button name in <code>addroute.html</code> using angularjs. The getelementbyid is not working. I need to use this getelementbyid procedure. Please help me</p>
  
  <blockquote>
    <p>web.html</p>
  </blockquote>
  
  <pre><code>&lt;body ng-controller='webctrl'&gt;
  &lt;div id="content"&gt;
      &lt;button id="share" name="share" class="btn btn-info btn-cust" ng-click="submit()" style="display: block;"&gt;CLICK TO ADDROUTE&lt;/button&gt;
  &lt;/div&gt;
  
  &lt;/body&gt;
  </code></pre>
  
  <blockquote>
    <p>addroute.html</p>
  </blockquote>
  
  <pre><code>&lt;body ng-controller='addctrl'&gt;
  &lt;div id="content"&gt;
      &lt;p&gt;Content = {{msg}}&lt;/p&gt;
      &lt;button id="subscribe" name="subscribe" class="btn btn-primary btn-cust" style="display: block;"&gt;&lt;/button&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <blockquote>
    <p>app.js</p>
  </blockquote>
  
  <pre><code>var app = angular.module("myApp", []);
  
  app.controller('webctrl', function ($scope, $window) {
  
  $scope.submit = function () {
  
     $window.open('addroute.html', '_self');
          }
   })
  
  app.controller('addctrl', function ($scope, $window) {
  
      $scope.msg = "Welcome";
      var btn = angular.element(document.getElementById('subscribe'));
      btn.textContent = "HHHHH";
  
     })
  </code></pre>