Angular ng-view/routing not working in PhoneGap

后端 未结 5 604
误落风尘
误落风尘 2020-11-27 12:10

I\'m having a problem with ngView in PhoneGap.

Everything seems to be loading just fine and I can even get a basic controller working using ng-controller. But when I

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-27 12:30

    My issue was the domain whitelisting.

    Basically your .config needs to look like this:

    angular.module('App', []).config(function ($routeProvider, $compileProvider) {
    
        $routeProvider.when('/test', {
            controller: TestCtrl,
            template: '

    {{ test }}

    ' }); $compileProvider.urlSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|tel):/); });

提交回复
热议问题