# Events not firing

**URL:** <https://forum.ionicframework.com/t/events-not-firing/13156>\
**Category:** ionic-v1\
**Created:** [November 25, 2014, 2:53am UTC](https://forum.ionicframework.com/t/events-not-firing/13156 "2014-11-25T02:53:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![americanslon](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@americanslon](https://forum.ionicframework.com/u/americanslon)\
**Post date:** [November 25, 2014, 2:53am UTC](https://forum.ionicframework.com/t/events-not-firing/13156/1 "2014-11-25T02:53:36Z")

</div>

I have a top level controller as follows

```
.controller('body', function ($scope, $ionicPlatform, $ionicLoading, SQL) {
$ionicLoading.show({
    template: 'Initializing...'
});

$ionicPlatform.ready(function () {
    console.log('platform Ready!');

    SQL.Init().then(function () {
        console.log('DB Ready!');
        $scope.initialized = true;
        $ionicLoading.hide();
    });

    document.addEventListener("online", function () { console.log("online"); }, false);
    document.addEventListener("offline", function () { console.log("offline"); }, false);
});
})

```

The problem I am having is that the online and offline events are not firing. I feel like there must be some more Ionic way but I am very new to framework.
