davej / angular-classy

Cleaner class-based controllers with Angular 1
http://davej.github.io/angular-classy/
813 stars 27 forks source link

$timeout is undefined #21

Closed OpenNoob closed 10 years ago

OpenNoob commented 10 years ago

Hi Dave,

Thanks for ng-classy. It's awesome.

I'm not sure if this is the right place to ask for support but I tried Google and nothing came up.

I have some issues with it when I use $timeout inside a scoped function like below:

emailformSend: function () {
          //....//
            this.$timeout(function () {
                this.$rootScope.ons.navigator.pushPage("partials/emailform.html");
            }, 500);
        }

The error is: Cannot read property '$rootScope' of undefined. This is my first use of ng-classy so am I doing something wrong?

Thanks!

davej commented 10 years ago

See #16.