mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-12-19 05:19:42 +08:00
a7f516f3f2e2c755c5b7fb196be335fa8fd4e4df
…
Ionic 2
Ionic 2 is the next generation of Ionic, the popular open-source mobile app development SDK that makes it easy to build top quality mobile apps with web technologies.
Ionic 2 is based on the new 2.x version of AngularJS, and comes with many significant performance, usability, and feature improvements.
For a quick intro to Ionic 2, see the guide.
Building & Running
- At the root of your
ionic2directory/repo, run:gulp update.angular. This will get the latest version of Angular2 master and install it as a sibling directory../angular-ionicto wherever yourionic2directory is. (It'll take a while to npm install angular2, so go grab a beer). - Cd into the
../angular-ionicdirectory and rungulp buildto build out the Angular files. If you are on a clean install, but../angular-ionicalready exists, rungulp link.angularto symlinkangular2in yourionic2working directory to../angular-ionic. This is for the SystemJS builder, which can't see below the root directory. - Run
npm installandjspm install. Make sure you have at least version 15.6 of JSPM. It should not alter yourconfig.jsorpackage.jsonfiles, if it does, make sure you have the proper version of JSPM. - In the
ionic2working directory, rungulp clean.build. This will transpile the Ionic project files to es5, bundle them using the SystemJS builder, bundle all of Ionic's dependencies (ie Angular2 and all of its dependencies) into a separate file, and build out all the Ionic examples as well. Indist/js/es6/ionicyou will find clean es6 Ionic files (no @Annotations), and indist/js/es5/ionicyou will find all of the Babel-transpiled es5 Ionic project files. The two bundles are located atdist/js/ionic.bundle.jsanddist/js/dependencies.js, and the examples are located indist/examples. - Run
gulp watch. - Go to http://localhost:8000/dist/examples/
- Stay cool
Note: Once you're setup, you just need to run gulp watch, unless you've updated angular and want to rebuild dependencies.js.
Things you'll probably need to fix
@Decoratoris now just@Directive- Components must use an element selector
NgElementis no longer a thing, it's nowElementRef. Stuff needs to be fixed.- All
main.jstest files were renamed toindex.jsto work with angular's build - imports that are relative paths should start with
./. For example, instead ofpath/moduleit should be./path/module Component,DirectiveandViewshould NOT be imported fromangular2/angular2. You'll probably get "No Directive annotation found on Content" when the wrong import is referenced.- Import those instead from:
import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
import {View} from 'angular2/src/core/annotations_impl/view';
Description
A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
angularcapacitorframeworkfrontendioniciosjavascriptmaterial-designmobilepwareactstencilstenciljstypescriptvuewebwebcomponents
Readme
MIT
2.5 GiB
Languages
TypeScript
60.5%
HTML
25.2%
SCSS
10.7%
JavaScript
2%
Vue
1%
Other
0.6%