Skip to content

Commit 13ca534

Browse files
committed
Publish source code for examples and exercises
1 parent dfeb872 commit 13ca534

File tree

252 files changed

+6313
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

252 files changed

+6313
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/node_modules

ionic2_ejems/ejem1/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules/
2+
www/build/
3+
platforms/
4+
plugins/
5+
.DS_Store

ionic2_ejems/ejem1/app/app.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import {App, Platform} from 'ionic-angular';
2+
import {StatusBar} from 'ionic-native';
3+
import {HomePage} from './pages/home/home';
4+
5+
6+
@App({
7+
template: '<ion-nav [root]="rootPage"></ion-nav>',
8+
config: {} // http://ionicframework.com/docs/v2/api/config/Config/
9+
})
10+
export class MyApp {
11+
rootPage: any = HomePage;
12+
13+
constructor(platform: Platform) {
14+
platform.ready().then(() => {
15+
// Okay, so the platform is ready and our plugins are available.
16+
// Here you can do any higher level native things you might need.
17+
StatusBar.styleDefault();
18+
});
19+
}
20+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<ion-navbar *navbar>
2+
<ion-title>
3+
Home
4+
</ion-title>
5+
</ion-navbar>
6+
7+
<ion-content class="home">
8+
<ion-card>
9+
<ion-card-header>
10+
Card Header
11+
</ion-card-header>
12+
<ion-card-content>
13+
Hello World
14+
</ion-card-content>
15+
</ion-card>
16+
</ion-content>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.home {
2+
3+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import {Page} from 'ionic-angular';
2+
3+
@Page({
4+
templateUrl: 'build/pages/home/home.html'
5+
})
6+
export class HomePage {}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// http://ionicframework.com/docs/v2/theming/
2+
3+
4+
// App Shared Imports
5+
// --------------------------------------------------
6+
// These are the imports which make up the design of this app.
7+
// By default each design mode includes these shared imports.
8+
// App Shared Sass variables belong in app.variables.scss.
9+
10+
@import '../pages/home/home';
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// http://ionicframework.com/docs/v2/theming/
2+
3+
4+
// App Shared Variables
5+
// --------------------------------------------------
6+
// Shared Sass variables go in the app.variables.scss file
7+
@import 'app.variables';
8+
9+
10+
// App iOS Variables
11+
// --------------------------------------------------
12+
// iOS only Sass variables can go here
13+
14+
15+
// Ionic iOS Sass
16+
// --------------------------------------------------
17+
// Custom App variables must be declared before importing Ionic.
18+
// Ionic will use its default values when a custom variable isn't provided.
19+
@import 'ionic.ios';
20+
21+
22+
// App Shared Sass
23+
// --------------------------------------------------
24+
// All Sass files that make up this app goes into the app.core.scss file.
25+
// For simpler CSS overrides, custom app CSS must come after Ionic's CSS.
26+
@import 'app.core';
27+
28+
29+
// App iOS Only Sass
30+
// --------------------------------------------------
31+
// CSS that should only apply to the iOS app
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// http://ionicframework.com/docs/v2/theming/
2+
3+
4+
// App Shared Variables
5+
// --------------------------------------------------
6+
// Shared Sass variables go in the app.variables.scss file
7+
@import 'app.variables';
8+
9+
10+
// App Material Design Variables
11+
// --------------------------------------------------
12+
// Material Design only Sass variables can go here
13+
14+
15+
// Ionic Material Design Sass
16+
// --------------------------------------------------
17+
// Custom App variables must be declared before importing Ionic.
18+
// Ionic will use its default values when a custom variable isn't provided.
19+
@import 'ionic.md';
20+
21+
22+
// App Shared Sass
23+
// --------------------------------------------------
24+
// All Sass files that make up this app goes into the app.core.scss file.
25+
// For simpler CSS overrides, custom app CSS must come after Ionic's CSS.
26+
@import 'app.core';
27+
28+
29+
// App Material Design Only Sass
30+
// --------------------------------------------------
31+
// CSS that should only apply to the Material Design app
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// http://ionicframework.com/docs/v2/theming/
2+
3+
4+
// App Shared Variables
5+
// --------------------------------------------------
6+
// To customize the look and feel of this app, you can override
7+
// the Sass variables found in Ionic's source scss files. Setting
8+
// variables before Ionic's Sass will use these variables rather than
9+
// Ionic's default Sass variable values. App Shared Sass imports belong
10+
// in the app.core.scss file and not this file. Sass variables specific
11+
// to the mode belong in either the app.ios.scss or app.md.scss files.
12+
13+
14+
// App Shared Color Variables
15+
// --------------------------------------------------
16+
// It's highly recommended to change the default colors
17+
// to match your app's branding. Ionic uses a Sass map of
18+
// colors so you can add, rename and remove colors as needed.
19+
// The "primary" color is the only required color in the map.
20+
// Both iOS and MD colors can be further customized if colors
21+
// are different per mode.
22+
23+
$colors: (
24+
primary: #387ef5,
25+
secondary: #32db64,
26+
danger: #f53d3d,
27+
light: #f4f4f4,
28+
dark: #222,
29+
favorite: #69BB7B
30+
);
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// http://ionicframework.com/docs/v2/theming/
2+
3+
4+
// App Shared Variables
5+
// --------------------------------------------------
6+
// Shared Sass variables go in the app.variables.scss file
7+
@import 'app.variables';
8+
9+
10+
// App Windows Variables
11+
// --------------------------------------------------
12+
// Windows only Sass variables can go here
13+
14+
15+
// Ionic Windows Sass
16+
// --------------------------------------------------
17+
// Custom App variables must be declared before importing Ionic.
18+
// Ionic will use its default values when a custom variable isn't provided.
19+
@import "ionic.wp";
20+
21+
22+
// App Shared Sass
23+
// --------------------------------------------------
24+
// All Sass files that make up this app goes into the app.core.scss file.
25+
// For simpler CSS overrides, custom app CSS must come after Ionic's CSS.
26+
@import 'app.core';
27+
28+
29+
// App Windows Only Sass
30+
// --------------------------------------------------
31+
// CSS that should only apply to the Windows app

ionic2_ejems/ejem1/config.xml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<widget id="com.ionicframework.ejem1964554" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
3+
<name>ejem1</name>
4+
<description>An Ionic Framework and Cordova project.</description>
5+
<author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>
6+
<content src="index.html"/>
7+
<access origin="*"/>
8+
<allow-intent href="http://*/*"/>
9+
<allow-intent href="https://*/*"/>
10+
<allow-intent href="tel:*"/>
11+
<allow-intent href="sms:*"/>
12+
<allow-intent href="mailto:*"/>
13+
<allow-intent href="geo:*"/>
14+
<platform name="android">
15+
<allow-intent href="market:*"/>
16+
</platform>
17+
<platform name="ios">
18+
<allow-intent href="itms:*"/>
19+
<allow-intent href="itms-apps:*"/>
20+
</platform>
21+
<preference name="webviewbounce" value="false"/>
22+
<preference name="UIWebViewBounce" value="false"/>
23+
<preference name="DisallowOverscroll" value="true"/>
24+
<preference name="android-minSdkVersion" value="16"/>
25+
<preference name="BackupWebStorage" value="none"/>
26+
<feature name="StatusBar">
27+
<param name="ios-package" onload="true" value="CDVStatusBar"/>
28+
</feature>
29+
</widget>

ionic2_ejems/ejem1/gulpfile.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
var gulp = require('gulp'),
2+
gulpWatch = require('gulp-watch'),
3+
del = require('del'),
4+
argv = process.argv;
5+
6+
/**
7+
* Ionic Gulp tasks, for more information on each see
8+
* https://github.com/driftyco/ionic-gulp-tasks
9+
*/
10+
var buildWebpack = require('ionic-gulp-webpack-build');
11+
var buildSass = require('ionic-gulp-sass-build');
12+
var copyHTML = require('ionic-gulp-html-copy');
13+
var copyFonts = require('ionic-gulp-fonts-copy');
14+
15+
gulp.task('watch', ['sass', 'html', 'fonts'], function(){
16+
gulpWatch('app/**/*.scss', function(){ gulp.start('sass'); });
17+
gulpWatch('app/**/*.html', function(){ gulp.start('html'); });
18+
return buildWebpack({ watch: true });
19+
});
20+
gulp.task('build', ['sass', 'html', 'fonts'], buildWebpack);
21+
gulp.task('sass', buildSass);
22+
gulp.task('html', copyHTML);
23+
gulp.task('fonts', copyFonts);
24+
gulp.task('clean', function(done){
25+
del('www/build', done);
26+
});
27+
28+
/**
29+
* Ionic hooks
30+
* Add ':before' or ':after' to any Ionic project command name to run the specified
31+
* tasks before or after the command.
32+
*/
33+
gulp.task('serve:before', ['watch']);
34+
gulp.task('emulate:before', ['build']);
35+
gulp.task('deploy:before', ['build']);
36+
37+
// we want to 'watch' when livereloading
38+
var shouldWatch = argv.indexOf('-l') > -1 || argv.indexOf('--livereload') > -1;
39+
gulp.task('run:before', [shouldWatch ? 'watch' : 'build']);

0 commit comments

Comments
 (0)