Angular 1.6的iOS和android Web View问题

时间:2018-09-24 07:24:11

标签: android ios angularjs html5 webview

HTML(静态HTML)页面中的所有内容都不会显示在Android和IOS WebView中,而是显示在浏览器中。

我使用angular js 1.6和下面的配置文件。

'use strict';

teatApp.config(['$ocLazyLoadProvider', 'localStorageServiceProvider', '$stateProvider', '$urlRouterProvider', '$locationProvider', 
function ($ocLazyLoadProvider, localStorageServiceProvider, $stateProvider, $urlRouterProvider, $locationProvider) {
    localStorageServiceProvider.setPrefix('teatApp');

    $ocLazyLoadProvider.config({
        debug: false,
        events: true,
    });

    $urlRouterProvider.otherwise('/home');
    $locationProvider.html5Mode(true);

    // $locationProvider.html5Mode({
        // enabled: true,
        // requireBase: false
    // });



    $stateProvider
    .state('home', {
        url: '/home',
        templateUrl: 'angular_view/Index/indexbody.html',
        controller: 'indexBodyController',
        resolve: {
            loadMyFile: function ($ocLazyLoad) {
                return $ocLazyLoad.load({
                    name: 'teatApp',
            files['angular_project_file/controllers/indexBodyController.js']
                })
            }
        } // END state
    }).state('aboutus', {
        url: '/about-us',
        templateUrl: 'angular_view/aboutus/aboutus.html',

    }).state('contactus', {
        url: '/contact-us',
        templateUrl: 'angular_view/contactus/contactus.html',

    }).state('faq', {
        url: '/FAQ',
        templateUrl: 'angular_view/faq/faq.html',

    }).state('terms', {
        url: '/terms-and-conditions',
        templateUrl: 'angular_view/terms/terms.html',

    });
  }
  ]);

基本上,此URL在浏览器中显示,但在Andriod和IOS Web视图中不显示。 谢谢你。

0 个答案:

没有答案