ionic加载html5,ionic设置html5model后,无法正常显示页面,在线等,急

这是一个奇怪的问题,当我设置了HTML5MODEL之后,无法正常访问页面

第一步 设置HTML

或者

第二步 开启HTML5MODEL

$locationProvider.html5Mode(true);

第三步 设置apache .htaccess

RewriteEngine On

RewriteBase /test/ionic/

RewriteRule ^index\.html$ - [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /test/ionic/index.html [L]

设置完成后,刷新首页,能够正常访问首页

但是在点击 ion-tabs 里面的其他任何链接的时候,就无任何反应

如下代码运行后具体步骤为:

直接访问首页 app/home ,正常

点击 about ,无任何反应

直接访问 app/about ,也正常

值得说明的是,如果不用ionic,那么就可以完全正常的访问任何一个链接

完整的代码

Tabs Example

Scientific Facts

Banging your head against a wall uses 150 calories an hour.

Dogs have four toes on their hind feet, and five on their front feet.

The ant can lift 50 times its own weight, can pull 30 times its own weight and always falls over on its right side when intoxicated.

A cockroach will live nine days without it's head, before it starves to death.

Polar bears are left handed.

Home

More Facts

111,111,111 x 111,111,111 = 12,345,678,987,654,321

1 in every 4 Americans has appeared on T.V.

11% of the world is left-handed.

1 in 8 Americans has worked at a McDonalds restaurant.

$283,200 is the absolute highest amount of money you can win on Jeopardy.

101 Dalmatians, Peter Pan, Lady and the Tramp, and Mulan are the only Disney cartoons where both parents are present and don't die throughout the movie.

Home

Scientific Facts

Create hybrid mobile apps with the web technologies you love.

Free and open source, Ionic offers a library of mobile-optimized HTML, CSS and JS components for building highly interactive apps.

Built with Sass and optimized for AngularJS.

Tabs Nav Stack

9cb38369b674058a853c07b5548ec842.png

@IonicFramework

@DriftyTeam

angular.module('ionicApp', ['ionic'])

.config(function($stateProvider, $urlRouterProvider,$ionicConfigProvider,$locationProvider) {

$locationProvider.html5Mode(true);

$ionicConfigProvider.platform.ios.tabs.style('standard');

$ionicConfigProvider.platform.ios.tabs.position('bottom');

$ionicConfigProvider.platform.android.tabs.style('standard');

$ionicConfigProvider.platform.android.tabs.position('standard');

$ionicConfigProvider.platform.ios.navBar.alignTitle('center');

$ionicConfigProvider.platform.android.navBar.alignTitle('left');

$ionicConfigProvider.platform.ios.backButton.previousTitleText('').icon('ion-ios-arrow-thin-left');

$ionicConfigProvider.platform.android.backButton.previousTitleText('').icon('ion-android-arrow-back');

$ionicConfigProvider.platform.ios.views.transition('ios');

$ionicConfigProvider.platform.android.views.transition('android');

$stateProvider

.state('app', {

url: "/app",

abstract: true,

templateUrl: "templates/tabs.html"

})

.state('app.home', {

url: "/home",

views: {

'home-tab': {

templateUrl: "templates/home.html",

controller: 'HomeTabCtrl'

}

}

})

.state('app.facts', {

url: "/facts",

views: {

'home-tab': {

templateUrl: "templates/facts.html"

}

}

})

.state('app.facts2', {

url: "/facts2",

views: {

'home-tab': {

templateUrl: "templates/facts2.html"

}

}

})

.state('app.about', {

url: "/about",

views: {

'about-tab': {

templateUrl: "templates/about.html"

}

}

})

.state('app.navstack', {

url: "/navstack",

views: {

'about-tab': {

templateUrl: "templates/nav-stack.html"

}

}

})

.state('app.contact', {

url: "/contact",

views: {

'contact-tab': {

templateUrl: "templates/contact.html"

}

}

});

$urlRouterProvider.otherwise("/app/home");

})

.controller('HomeTabCtrl', function($scope) {

console.log('HomeTabCtrl');

});

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值