angularjs - Unit test onEnter with ui-router -


i have state onenter block following. i'm trying redirect based on data.length.

  .state('home', {     url: '/',     data: {       title: 'home',     },     controller: 'homectrl home',     templateprovider: function($templatecache) {       return $templatecache.get('views/home.html');     },     onenter: function(data, $state) {);       if (data.length === 2) {         $state.go('profile');       }     }   }); 

how can unit-test piece of code?


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -