shammon shammon - 4 months ago 318x
AngularJS Question

Perform onload() in ionic

I want to load a function when a page loads.So how to use native javascript onload function in ionic.Here is sample html page.

<ion-view title="Account" >
<ion-content class="has-header padding">
<button id="bt">test</button>

here is my javascript file

function testload(){

alert("page loaded");

I want to load the this when page is loaded.How it possible in ionicframework?


What about using the controller associated with that view?

.controller('YourCtrl', function($scope, $stateParams, Something) {
    alert("page loaded");