Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
538 views
in Technique[技术] by (71.8m points)

html - What steps do I need to take to use the Ionic Framework with trigger.io?

I unsuccessfully searched for some documentation of how to integrate the Ionic Framework with trigger.io, but I don't see any.

If anyone knows or has some, I'd love to see them. If not, I'll venture forward and post my steps here :)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Including Ionic Framework

Ionic Framework provides CSS and JavaScript libraries that you would include in your HTML. There are two methods for including Ionic Framework in your trigger.io app:

1. Store the Files Locally (development/production):

  • You can download the Ionic CSS and JavaScript files from the Ionic CDN.
  • Add the JS, CSS, and fonts folders to your src folder.
  • Reference ionic.min.css and ionic.bundle.js in your index.html file like so:
<link href="/css/ionic.min.css" rel="stylesheet"></link>
<script src="/js/ionic.bundle.js"></script>
  • This is the same as including any other libraries in your HTML.
  • Note that AngularJS is included in ionic.bundle.js, so I would suggest checking out the AngularJS API documentation.

2. Use a CDN (development only):

A content delivery network (CDN) is a system of servers that delivers files to a client efficiently based on location.

You can include Ionic files in your project by linking them from the Ionic CDN:

<link href="http://code.ionicframework.com/1.0.0-beta.1/css/ionic.css" rel="stylesheet">
<script src="http://code.ionicframework.com/1.0.0-beta.14/js/ionic.bundle.js"></script>

While Ionic is still in the beta stages you should make sure to always change your CDN link or download the new files whenever they release a new version.

I'd avoid using the CDN if possible, as it can cause problems if the phone loses internet connection. It also means that you are re-downloading the files every time the app runs.

Firebase

I'd also suggest checking out Firebase, a great backend solution for mobile apps. It can also handle user authentication.

<script src="https://cdn.firebase.com/js/client/2.2.1/firebase.js"></script>
<script src="https://cdn.firebase.com/libs/angularfire/0.9.2/angularfire.min.js"></script>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...