Cache custom component content in ionic 2
<p>I am creating a custom component which loads the innerHTML from a remote source. My question is how can i load the content when app loads. Right now, the content loads when the page shows and its a small delay until the text appears. Is there an event i can attach to that component to load the content when the app loads?</p>

<p>This is how my component looks like:</p>

<pre><code>import {Component} from 'angular2/core'
import {DataProvider} from '../../providers/DataProvider'

@Component({

    'selector': 'ck-tos',
    templateUrl: 'build/directives/ckTos/ckTos.html',
    providers: [[Cashklick]],
})

export class ckTos {

    content: String = "";

    constructor(private DataProvider: DataProvider) {

        DataProvider.load('pages', 'terms').subscribe(
            data =&gt; {

                let response = data.json();
                if (response.content)
                    this.content = response.content;
                else if (response.error)
                    this.content = response.error;
                else
                    this.content = "Error: Unable to get any data ...";

            },
            err =&gt; {this.content = "Error: Unable to get any data ...";},
            () =&gt; console.log('DataProvider service for page terms completed')
        );
    }

}
</code></pre>

<p>When i open the app, i want this component to have content variable loaded and used without calling the remote service each time the component is rendered.</p>