Cordova/Angular/Mobile View Navigation Causes Cannot call method 'triggerBeforeShow' of undefined

4 posts, 0 answers
  1. Patrick
    Patrick avatar
    29 posts
    Member since:
    Apr 2014

    Posted 04 Apr 2016 Link to this post

    I have an angular application that runs fine on the web and in ripple but the following error on my android device and in the android emulator:

    Uncaught TypeError: Cannot call method 'triggerBeforeShow' of undefined


    The application has a stub default view that redirects to the main home view.


    A sample cordova project to reproduce the error is included.  Run from VS Empulator 5" KitKat or from an android device.

    <!DOCTYPE html>
        <meta charset="utf-8" />
            Customize the content security policy in the meta tag below as needed. Add 'unsafe-inline' to default-src to enable inline JavaScript.
            For details, see
        <meta http-equiv="Content-Security-Policy" content="default-src  'self' ; ; ; https://localhost:44309/   https://localhost:44300/ 'unsafe-eval' 'unsafe-inline' data: gap: 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *">
        <!-- CorovaStartupNavigationTest references -->
        <link href="css/" rel="stylesheet" />
        <script src="scripts/index.js"></script>
    <body kendo-mobile-application skin="'flat'" ng-app="sushiMobileApp">
        <kendo-mobile-view id="viewLogin" data-title="Login" ng-controller="indexController" k-on-before-show="showHome(kendoEvent)">
        <script src="cordova.js"></script>
        <script src="scripts/platformOverrides.js"></script>
        <script src="scripts/jquery.min.js"></script>
        <script src="scripts/angular.js"></script>
        <script src="scripts/kendo.all.min.js"></script>
        <script src="app/modules/cdlogin.js"></script>
            angular.module('sushiMobileApp', ['kendo.directives', 'cdlogin'])
             .controller('indexController', ['$scope', function ($scope) {
                 $scope.showHome = function (kendoEvent) {
                 $scope.onCommand = function (kendoEvent) {
                     $scope.command ="command");
                     switch ($scope.command) {
                         case "login":
  2. Patrick
    Patrick avatar
    29 posts
    Member since:
    Apr 2014

    Posted 05 Apr 2016 Link to this post

    Support indicated to use prevent default in my before show redirect or set initial page view initial syntax but... neither of these suggestions affect the reproducible error which is that the login button does not work on Android devices in cordova.
  3. Petyo
    Petyo avatar
    2444 posts

    Posted 06 Apr 2016 Link to this post


    This does not sound like a known issue. The code below does not seem to be complete - you refer to a button which I am unable to fiund. May you please post a runnable sample of your case (including the suggestions we provided)? You may use plunker for that purpose, in case the problem needs a multiple files like remote views.

    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  4. Patrick
    Patrick avatar
    29 posts
    Member since:
    Apr 2014

    Posted 07 Apr 2016 in reply to Petyo Link to this post

    I was able to address the issue.  The issue was caused by including a leading "\" in my application navigate which works on the web platform but not on the device.   The cryptic error messages are very hard to debug but I was able to solve the problem.
Back to Top