The advantages of the Meteor framework are self-evident, it greatly reduces the burden of the development of the front and back of the app, and in May this year won the B-round 20 million financing, representing the market for it a free, open source development framework affirmation. Cordova is the advantage of many plug-ins, ionic the advantage is that the UI is beautiful and performance is the best in the current Hybird framework, the technology involved in this article is used by the author, a brief summary of Meteor+cordova+ionic integration method.
1, create the project
Meteor Create ProjectName
CD [ProjectName]
Meteor Add urigo: Angular
Meteor Add urigo: Ionic
2,[projectname].html
<body ng-app= "starter" > <div ng-include= "' index.ng.html '" ></div></body>
3,tags.ng.html
<ion-tabs class= "Tabs-positive tabs-icon-only" > <ion-tab title= "Home" href= "#/tab/home" icon-on= " Ion-ios-filing "icon-off=" Ion-ios-filing-outline "> <ion-nav-view name=" Home-tab "></ion-nav-view > <!--tab 1 Content-- </ion-tab> <ion-tab title= "about" href= "#/tab/home2" icon-off= "Ion-ios-pulse" icon-on= "Ion-ios-pulse-strong" > <ion-nav-view name= "HOME-TAB2" ></ Ion-nav-view> <!--Tab 2 Content-- </ion-tab></ion-tabs>
4,states Config Code
App. Config (function ($stateProvider, $urlRouterProvider) { $stateProvider . State (' tabs ', { URL: "/tab", abstract:true, templateurl: "tabs.ng.html" }) . State (' Tabs.home ', { URL: '/home ', views : { ' Home-tab ': { templateurl: "home.ng.html", Controller: ' Hometabctrl '}} ) . State (' tabs.home2 ', { URL: '/home2 ', views : { ' home-tab2 ': { templateurl: ' home2.ng.html ' } } }); $urlRouterProvider. Otherwise ("/tab/home"); })
Code for 5,APP Init
if (meteor.isclient) { var app = Angular.module (' starter ', [ ' Angular-meteor ', ' ui.router ', ' ionic ') ]); ...
6, add Inappbrower plugin
Meteor Add Cordova:[email protected]://github.com/meteor/cordova-plugin-inappbrowser/tarball/ 8012ae709bb749eaad434c05cd7e2aeda8f3a425
Where tarball/is followed by SHA1, which can be viewed in each submission of GitHub:
You can click the icon copy directly.
6, removing the syntax of Cordova plugin
Meteor Remove Cordova:org.apache.cordova.inappbrowser
The use of 7,inappbrower
See Https://github.com/meteor/cordova-plugin-inappbrowser
Report:
How to use the Ionic component tabs in Meteor, and how to add using Cordova plugin Inappbrower