AngularJS + Ionic - Append content to another page/view
<p>I am new to angularjs and ionic and I can not seem to figure out how to append content to another page/view once I click a button. Right now once I click the "append" button the content appears below the button on the homepage but I want it to appear on the second page. Any suggestions?</p>

<p><strong>tab-home.html</strong></p>

<pre><code>&lt;ion-view view-title="Home"&gt;
      &lt;ion-content&gt;

    &lt;h2&gt;Welcome to Homepage&lt;/h2&gt;
    &lt;button class="button" ng-click="AppendText()"&gt;Append&lt;/button&gt;
    &lt;!--&lt;div id="divID"&gt;&lt;/div&gt;--&gt; // Text 'Hi" only displays on homepage
&lt;/ion-content&gt;
&lt;/ion-view&gt;
</code></pre>

<p><strong>controller.js</strong></p>

<pre><code>.controller('SecondCtrl', function($scope) {
   $scope.AppendText = function() {
     var myEl = angular.element( document.querySelector( '#divID' ) );
     myEl.append('Hi&lt;br/&gt;');     
    }
})
</code></pre>

<p><strong>tab-second.html</strong></p>

<pre><code>&lt;ion-view view-title="Second Page"&gt;
  &lt;ion-content&gt;

  &lt;div id="divID"&gt;&lt;/div&gt;

&lt;/ion-content&gt;
&lt;/ion-view&gt;
</code></pre>