First, ion-tabs instruction + Routing usage example
1. Routing Configuration
Angular.module (' Ionicapp ', [' Ionic ']). config (function ($stateProvider, $urlRouterProvider) {$stateProvider.
State (' tabs ', {url: "/tab", Abstract:true, Templateurl: "Templates/tabs.html" }). State (' Tabs.home ', {url: "/home", Views: {' Home-tab ': {//Specify the Vie belonging to)
W View templateurl: "Templates/home.html", Controller: ' Hometabctrl '
}}). State (' tabs.facts ', {url: '/facts ', views: { ' Home-tab ': {templateurl: ' Templates/facts.html '}}}.
State (' tabs.facts2 ', {url: '/facts2 '), Views: {' Home-tab ': {
Templateurl: "Templates/facts2.html"}}). State (' Tabs.about ', {
URL: "/about", Views: {' About-tab ': {templateurl: "templates/about.html"}
}). State (' Tabs.navstack ', {url: '/navstack ', views: {
' About-tab ': {templateurl: "Templates/nav-stack.html"}}})
. State (' tabs.contact ', {url: '/contact '), Views: {' Contact-tab ': {
Templateurl: "Templates/contact.html"}});
$urlRouterProvider. Otherwise ("/tab/home"); }). controller (' Hometabctrl ', function ($scope) {console.log (' Hometabctrl ');});
2. Page configuration
<body ng-app= "Ionicapp" ng-controller= "Hometabctrl" >
<ion-nav-bar class= "bar-positive" >
< ion-nav-back-button></ion-nav-back-button>
</ion-nav-bar>
<ion-nav-view></ Ion-nav-view>
3. Page Card Configuration
<!--home page content--> <script id= "templates/tabs.html" type= "text/ng-template" > <ion-tabs class= " Tabs-icon-top tabs-positive "> <ion-tab title=" Home "icon=" Ion-home "href=" #/tab/home "> <io N-nav-view name= "Home-tab" ></ion-nav-view> </ion-tab> <ion-tab title= "About icon=" ion-i Os-information "href=" #/tab/about "> <ion-nav-view name=" about-tab "></ion-nav-view> < /ion-tab> <ion-tab title= "Contact" icon= "Ion-ios-world" ui-sref= "Tabs.contact" > <ion-nav-v Iew name= "Contact-tab" ></ion-nav-view> </ion-tab> </ion-tabs> </script> <script Id= "templates/home.html" type= "text/ng-template" > <ion-view view-title= "Home" > <ion-content class = "padding" > <p> <a class= "button icon icon-right ion-chevron-right" href= "#/tab/fa
CTS ">scientific facts</a> </p> </ion-content> </ion-view> </script>
Effect Chart:
More:
Ionic tab TAB use Collation (ii)
Ionic tab TAB use Collation (i)
Cordova Configuration WebView can open external links