• Resolved wkempferjr

    (@wkempferjr)


    Intermittently, my app was throwing this error in the console: Uncaught Error: [$injector:modulerr]. It seemed to be related to loading angular over the CDN and so I turned that off in the settings (Settings->WP NG->Advanced, uncheck Enable the angular cdn with fallback). That caused an undefined variable error in public/class-wp-ng-public-fallback.php on line 58. Moving the declaration and assignment of $bower outside the scope of the if ( wp_ng_is_cdn_angular() ) statement so that it will be defined in the wp_register_script call starting on line 54, as shown below, seems to fix the problem. Could this change be included in the next release?

    `$bower = new Wp_Ng_Bower();
    if ( wp_ng_is_cdn_angular() ) {
    $src = $bower->map_to_cdn([
    ‘name’ => ‘angular’,
    ‘cdn’ => ‘google-angular’,
    ‘file’ => ‘angular.min.js’
    ], wp_ng_get_asset_path(‘scripts/angular.js’));
    }
    else {
    $src = wp_ng_get_asset_path(‘scripts/angular.js’);
    }

    wp_register_script(
    ‘angular’,
    $src,
    $deps,
    $bower->get_version(‘angular’),
    true
    );`

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author redcastor

    (@redcastor)

    Thanks for your report.
    Yes its right.

    I change this in the next release.

    Regards

    Plugin Author redcastor

    (@redcastor)

    Plugin Updated
    This bug is fixed

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Problems related to CDN’ is closed to new replies.