diff --git a/README.md b/README.md
index 1445902aea..f8aaf01efd 100644
--- a/README.md
+++ b/README.md
@@ -1,15 +1,29 @@
#### Building & Running
-- `gulp watch`
-- `httpster`
-- `open http://localhost:9000/e2e/aside/basic/index.html`
-- Follow the structure found in src/components/aside/examples/basic
- to create more examples.
- * The biggest thing to remember: your app has to import its dependencies with the `app/` prefix.
- For example `import {Apple} from 'apple';` would import apple.js in your example app.
+_** WARNING: This is a temporary hack **_
+
+1. At the root of your `ionic2` directory/repo, run: `gulp update.angular`. This will get the latest version of Angular2 master and install it as a sibling directory `../angular` to wherever your `ionic2` directory is. (It'll take a while to npm install angular2, so go grab a beer).
+2. In the `ionic2` working directory, run `gulp watch`. This will copy ionic2 components and test files to the correct angular directories as you're developing.
+3. In another terminal, `cd` into the `../angular` directory, and run `gulp serve.js.dev`. This will build out ionic examples too.
+4. Go to [http://localhost:8000/examples/src/ionic/](http://localhost:8000/examples/src/ionic/)
+5. Stay cool
+
+_** WARNING: This is a temporary hack **_
-#### Update Angular
+#### Things you'll probably need to fix
+
+- `@Decorator` is now just `@Directive`
+- Components must use an element selector
+- NgElement is not longer a thing, it's now ElementRef. Stuff needs to be fixed.
+- All `main.js` test files were renamed to `index.js` to work with angular's build
+- imports that are relative paths should start with `./`. For example, instead of `path/module` it should be `./path/module`
+- `Component`, `Directive` and `View` should NOT be imported from `angular2/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';
+```
- ./scripts/build/update-angular.sh
diff --git a/gulpfile.js b/gulpfile.js
index 3b55424609..841532c0d2 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -1,66 +1,86 @@
var _ = require('lodash');
var buildConfig = require('./scripts/build/config');
-var SystemJsBuilder = require('systemjs-builder');
-var exec = require('child_process').exec;
var fs = require('fs');
var gulp = require('gulp');
var karma = require('karma').server;
var path = require('path');
var VinylFile = require('vinyl');
-
var argv = require('yargs').argv;
-var babel = require('gulp-babel');
var cached = require('gulp-cached');
var concat = require('gulp-concat');
-var debug = require('gulp-debug');
var del = require('del');
var gulpif = require('gulp-if');
-var karma = require('karma').server;
-var plumber = require('gulp-plumber');
var rename = require('gulp-rename');
var sass = require('gulp-sass');
-var shell = require('gulp-shell');
var through2 = require('through2');
-var traceur = require('gulp-traceur');
+var runSequence = require('run-sequence');
+var watch = require('gulp-watch');
-require('./scripts/snapshot/snapshot.task')(gulp, argv, buildConfig);
+// !!! TEMP HACK !!!
+// first run ./update-angular.sh
+gulp.task('watch', function() {
+
+ runSequence(
+ 'clean',
+ 'ionic.copy.js',
+ 'ionic.examples',
+ 'sass',
+
+ function() {
+ watch('ionic/**/*.js', function() {
+ gulp.start('ionic.copy.js');
+ });
+
+ watch('ionic/components/*/test/**/*', function() {
+ gulp.start('ionic.examples');
+ });
+
+ watch('ionic/components/**/*.scss', function() {
+ gulp.start('sass');
+ });
+ })
-gulp.task('default', ['clean'], function() {
- gulp.run('build');
});
-gulp.task('build', ['e2e', 'ionic-js', 'ng2', 'sass']);
-
-gulp.task('lib', ['fonts', 'dependencies']);
-
-gulp.task('watch', ['default'], function() {
- gulp.watch(buildConfig.src.scss, ['sass'])
- gulp.watch([].concat(
- buildConfig.src.js, buildConfig.src.html,
- 'scripts/e2e/index.template.html'
- ), ['e2e'])
- gulp.watch([].concat(
- buildConfig.src.e2e, buildConfig.src.html,
- 'scripts/e2e/index.template.html'
- ), ['ionic-js'])
+gulp.task('clean', function(done) {
+ del(['../angular/modules/ionic, ./angular/modules/examples/src/ionic'], done);
});
-gulp.task('karma', function() {
- return karma.start({ configFile: __dirname + '/scripts/test/karma.conf.js' })
+
+gulp.task('ionic.copy.js', function(done) {
+ return gulp.src(['ionic/**/*.js', '!ionic/components/*/test/**/*'])
+ .pipe(gulp.dest('../angular/modules/ionic'));
});
-gulp.task('karma-watch', function() {
- return karma.start({ configFile: __dirname + '/scripts/test/karma-watch.conf.js' })
+
+gulp.task('ionic.examples', function() {
+ var indexContents = _.template( fs.readFileSync('scripts/e2e/angular.template.html') )({
+ buildConfig: buildConfig
+ });
+
+ // Get each test folder with gulp.src
+ return gulp.src('ionic/components/*/test/*/**/*')
+ .pipe(rename(function(file) {
+ file.dirname = file.dirname.replace(path.sep + 'test' + path.sep, path.sep)
+ }))
+ .pipe(gulpif(/index.js$/, processMain()))
+ .pipe(gulp.dest('../angular/modules/examples/src/ionic'))
+
+ function processMain() {
+ return through2.obj(function(file, enc, next) {
+ var self = this;
+ self.push(new VinylFile({
+ base: file.base,
+ contents: new Buffer(indexContents),
+ path: path.join(path.dirname(file.path), 'index.html'),
+ }));
+ next(null, file);
+ })
+ }
+
});
-gulp.task('dependencies', function() {
- var copyFrom = buildConfig.scripts
- .map(function(data) { return data.from; })
- .filter(function(item) { return !!item; });
- return gulp.src(copyFrom)
- .pipe(gulp.dest(buildConfig.distLib))
-});
gulp.task('sass', function() {
return gulp.src('ionic/ionic.scss')
@@ -72,14 +92,76 @@ gulp.task('sass', function() {
.pipe(gulp.dest('dist/css'));
});
+
+gulp.task('update.angular', function(done) {
+
+ if (!fs.existsSync('../angular')) {
+ fs.mkdirSync('../angular');
+
+ console.log('cloning angular master...');
+ exec('git clone git@github.com:angular/angular ../angular', function() {
+ npmInstall();
+ });
+
+ } else {
+ console.log('angular master: cleaning modules');
+ del(['../angular/modules'], function() {
+
+ console.log('angular master: reset --hard...');
+ exec('git reset --hard origin/master', {cwd: '../angular'}, function () {
+
+ console.log('angular master: git pull origin master...');
+ exec('git pull origin master', function () {
+ npmInstall();
+ });
+ });
+
+ })
+ }
+
+ function npmInstall() {
+ console.log('angular master: npm install (may take a while, chill out)...');
+ exec('npm install', {cwd: '../angular'}, function () {
+ done();
+ });
+ }
+
+});
+
+
+
+require('./scripts/snapshot/snapshot.task')(gulp, argv, buildConfig);
+
+
+// gulp.task('watch', ['default'], function() {
+// gulp.watch(buildConfig.src.scss, ['sass'])
+// gulp.watch([].concat(
+// buildConfig.src.js, buildConfig.src.html,
+// 'scripts/e2e/index.template.html'
+// ), ['e2e'])
+// gulp.watch([].concat(
+// buildConfig.src.e2e, buildConfig.src.html,
+// 'scripts/e2e/index.template.html'
+// ), ['ionic-js'])
+// });
+
+gulp.task('karma', function() {
+ return karma.start({ configFile: __dirname + '/scripts/test/karma.conf.js' })
+});
+
+gulp.task('karma-watch', function() {
+ return karma.start({ configFile: __dirname + '/scripts/test/karma-watch.conf.js' })
+});
+
gulp.task('fonts', function() {
return gulp.src('ionic/components/icon/fonts/**/*')
.pipe(gulp.dest('dist/fonts'));
});
-gulp.task('clean', function(done) {
- del([buildConfig.dist], done);
-});
+
+
+
+
gulp.task('e2e', ['ionic-js', 'sass'], function() {
var indexContents = _.template( fs.readFileSync('scripts/e2e/index.template.html') )({
@@ -100,8 +182,8 @@ gulp.task('e2e', ['ionic-js', 'sass'], function() {
file.dirname = file.dirname.replace(path.sep + 'test' + path.sep, path.sep)
}))
.pipe(gulpif(/main.js$/, processMain()))
- .pipe(gulpif(/e2e.js$/, createPlatformTests()))
- .pipe(gulp.dest(buildConfig.dist + '/e2e'))
+ //.pipe(gulpif(/e2e.js$/, createPlatformTests()))
+ //.pipe(gulp.dest(buildConfig.dist + '/e2e'))
function processMain() {
return through2.obj(function(file, enc, next) {
@@ -112,37 +194,9 @@ gulp.task('e2e', ['ionic-js', 'sass'], function() {
path: path.join(path.dirname(file.path), 'index.html'),
}));
next(null, file);
-
- // var builder = new SystemJsBuilder({
- // baseURL: __dirname,
- // traceurOptions: { annotations: true, types: true },
- // meta: {
- // 'angular2/angular2': { build: false },
- // 'ionic/ionic': { build: false },
- // },
- // map: {
- // hammer: 'node_modules/hammerjs/hammer',
- // rx: 'node_modules/rx'
- // },
- // paths: {
- // 'angular2/*': 'dist/lib/angular2/*.js',
- // 'app/*': path.dirname(file.path) + '/*.js'
- // },
- // });
- // builder.build('app/main').then(function(output) {
- // self.push(new VinylFile({
- // base: file.base,
- // contents: new Buffer(output.source),
- // path: file.path,
- // }));
- // next();
- // })
- // .catch(function(err) {
- // console.log('error', err);
- // throw new Error(err);
- // });
})
}
+
function createPlatformTests(file) {
return through2.obj(function(file, enc, next) {
var self = this
@@ -166,43 +220,3 @@ gulp.task('e2e', ['ionic-js', 'sass'], function() {
}
});
-
-gulp.task('ng2-copy', function() {
- return gulp.src('node_modules/angular2/es6/prod/**/*.es6')
- .pipe(rename({ extname: '.js' }))
- .pipe(gulp.dest(path.join(buildConfig.distLib, 'angular2')));
-});
-
-gulp.task('ng2', ['lib', 'ng2-copy'], function() {
- var builder = new SystemJsBuilder({
- paths: {
- "angular2/*": "node_modules/angular2/es6/prod/*.es6",
- "rx/*": "node_modules/angular2/node_modules/rx/*.js"
- }
- });
- return builder.build('angular2/angular2', path.join(buildConfig.distLib, 'angular2.js')).then(function() {
- return builder.build('angular2/di', path.join(buildConfig.distLib, 'angular2-di.js'));
- });
-});
-
-gulp.task('ng2-di', ['ng2'], function() {
-});
-
-gulp.task('ionic-js', function() {
- var builder = new SystemJsBuilder({
- traceurOptions: {
- annotations: true,
- types: true,
- },
- meta: {
- 'angular2/angular2': { build: false },
- 'angular2/di': { build: false },
- },
- paths: {
- "hammer": 'node_modules/hammerjs/*.js',
- "angular2/*": "node_modules/angular2/es6/prod/*.es6",
- "rx/*": "node_modules/angular2/node_modules/rx/*.js",
- }
- });
- return builder.build('ionic/ionic', path.join(buildConfig.distLib, 'ionic2.js'));
-});
diff --git a/ionic/components/action-menu/test/basic/index.js b/ionic/components/action-menu/test/basic/index.js
new file mode 100644
index 0000000000..d09a9a6a1f
--- /dev/null
+++ b/ionic/components/action-menu/test/basic/index.js
@@ -0,0 +1,21 @@
+import {bootstrap} from 'angular2/angular2'
+import {Component} from 'angular2/src/core/annotations_impl/annotations';
+import {View} from 'angular2/src/core/annotations_impl/view';
+
+import {ActionMenu} from 'ionic/components/action-menu/action-menu';
+
+
+@Component({ selector: 'ion-app' })
+@View({
+ templateUrl: 'main.html',
+ directives: [ActionMenu]
+})
+class IonicApp {
+ constructor() {
+ console.log('IonicApp Start')
+ }
+}
+
+export function main() {
+ bootstrap(IonicApp);
+}
diff --git a/ionic/components/action-menu/test/basic/main.js b/ionic/components/action-menu/test/basic/main.js
deleted file mode 100644
index c7241870fa..0000000000
--- a/ionic/components/action-menu/test/basic/main.js
+++ /dev/null
@@ -1,16 +0,0 @@
-import {Component, View, bootstrap} from 'angular2/angular2';
-import {ActionMenu} from 'ionic/components/action-menu/action-menu';
-
-
-@Component({ selector: '[ion-app]' })
-@View({
- templateUrl: 'main.html',
- directives: [ActionMenu]
-})
-class IonicApp {
- constructor() {
- console.log('IonicApp Start')
- }
-}
-
-bootstrap(IonicApp)
diff --git a/ionic/components/alert/test/basic/main.js b/ionic/components/alert/test/basic/index.js
similarity index 50%
rename from ionic/components/alert/test/basic/main.js
rename to ionic/components/alert/test/basic/index.js
index 87d1337ce9..bdd37082f3 100644
--- a/ionic/components/alert/test/basic/main.js
+++ b/ionic/components/alert/test/basic/index.js
@@ -1,8 +1,11 @@
-import {Component, View, bootstrap} from 'angular2/angular2';
+import {bootstrap} from 'angular2/angular2'
+import {Component} from 'angular2/src/core/annotations_impl/annotations';
+import {View} from 'angular2/src/core/annotations_impl/view';
+
import {Alert} from 'ionic/components/alert/alert';
-@Component({ selector: '[ion-app]' })
+@Component({ selector: 'ion-app' })
@View({
templateUrl: 'main.html',
directives: [Alert]
@@ -19,4 +22,6 @@ class IonicApp {
}
}
-bootstrap(IonicApp)
+export function main() {
+ bootstrap(IonicApp);
+}
diff --git a/ionic/components/app/app.js b/ionic/components/app/app.js
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/ionic/components/app/test/animations/main.js b/ionic/components/app/test/animations/index.js
similarity index 91%
rename from ionic/components/app/test/animations/main.js
rename to ionic/components/app/test/animations/index.js
index 56b54abcc7..86cf0244fc 100644
--- a/ionic/components/app/test/animations/main.js
+++ b/ionic/components/app/test/animations/index.js
@@ -1,4 +1,7 @@
-import {Component, Decorator, View, NgElement, bootstrap} from 'angular2/angular2';
+import {bootstrap} from 'angular2/angular2'
+import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
+import {View} from 'angular2/src/core/annotations_impl/view';
+
import {Animation} from 'ionic/ionic';
let opacity = 0.2;
@@ -6,7 +9,7 @@ let rotateZ = '180deg';
let translateX = '100px';
let scale = 0.6;
-@Component({ selector: '[ion-app]' })
+@Component({ selector: 'ion-app' })
@View({
templateUrl: 'main.html'
})
@@ -143,4 +146,6 @@ class IonicApp {
}
-bootstrap(IonicApp)
+export function main() {
+ bootstrap(IonicApp);
+}
diff --git a/ionic/components/app/test/barkpark/main.js b/ionic/components/app/test/barkpark/index.js
similarity index 92%
rename from ionic/components/app/test/barkpark/main.js
rename to ionic/components/app/test/barkpark/index.js
index bfd405b062..ae5dcc28b8 100644
--- a/ionic/components/app/test/barkpark/main.js
+++ b/ionic/components/app/test/barkpark/index.js
@@ -1,5 +1,8 @@
//import {Router} from 'ionic/routing/router'
-import {For, Component, View, Parent, bootstrap} from 'angular2/angular2'
+import {For, Parent, bootstrap} from 'angular2/angular2'
+import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
+import {View} from 'angular2/src/core/annotations_impl/view';
+
import {FormBuilder, Validators, FormDirectives, ControlGroup} from 'angular2/forms';
import {Log} from 'ionic/util'
@@ -152,7 +155,7 @@ class SplashPage {
/**
* Main app entry point
*/
-@Component({ selector: '[ion-app]' })
+@Component({ selector: 'ion-app' })
@View({
directives: [Nav],
templateUrl: 'main.html'
@@ -194,4 +197,6 @@ class IonicApp {
}
}
-bootstrap(IonicApp);
+export function main() {
+ bootstrap(IonicApp);
+}
diff --git a/ionic/components/app/test/hn/main.js b/ionic/components/app/test/hn/index.js
similarity index 53%
rename from ionic/components/app/test/hn/main.js
rename to ionic/components/app/test/hn/index.js
index d56c86ab71..1a9c734c31 100644
--- a/ionic/components/app/test/hn/main.js
+++ b/ionic/components/app/test/hn/index.js
@@ -1,16 +1,20 @@
-import {Descendent, NgElement, Component, View, bootstrap} from 'angular2/angular2';
+import {NgElement} from 'angular2/angular2';
+import {bootstrap} from 'angular2/angular2'
+import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
+import {View} from 'angular2/src/core/annotations_impl/view';
+
import {bind} from 'angular2/di';
import {Content, Nav, NavPane} from 'ionic/ionic';
import {HackerNews} from 'hn';
import {HNTopStories} from 'pages/top';
-@Component({ selector: '[ion-app]' })
+@Component({ selector: 'ion-app' })
@View({
templateUrl: 'main.html',
directives: [Content, Nav, NavPane]
})
-export class HNApp {
+export class IonicApp {
constructor(
@NgElement() element:NgElement
) {
@@ -20,5 +24,7 @@ export class HNApp {
}
}
-bootstrap(HNApp);
+export function main() {
+ bootstrap(IonicApp);
+}
diff --git a/ionic/components/app/test/typography/index.js b/ionic/components/app/test/typography/index.js
new file mode 100644
index 0000000000..56917551fc
--- /dev/null
+++ b/ionic/components/app/test/typography/index.js
@@ -0,0 +1,18 @@
+import {bootstrap} from 'angular2/angular2'
+import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
+import {View} from 'angular2/src/core/annotations_impl/view';
+
+
+@Component({ selector: 'ion-app' })
+@View({
+ templateUrl: 'main.html'
+})
+class IonicApp {
+ constructor() {
+ console.log('IonicApp Start')
+ }
+}
+
+export function main() {
+ bootstrap(IonicApp);
+}
diff --git a/ionic/components/app/test/typography/main.js b/ionic/components/app/test/typography/main.js
deleted file mode 100644
index f43032d520..0000000000
--- a/ionic/components/app/test/typography/main.js
+++ /dev/null
@@ -1,13 +0,0 @@
-import {Component, View, bootstrap} from 'angular2/angular2';
-
-@Component({ selector: '[ion-app]' })
-@View({
- templateUrl: 'main.html'
-})
-class IonicApp {
- constructor() {
- console.log('IonicApp Start')
- }
-}
-
-bootstrap(IonicApp)
diff --git a/ionic/components/aside/test/basic/index.js b/ionic/components/aside/test/basic/index.js
new file mode 100644
index 0000000000..4552f6153f
--- /dev/null
+++ b/ionic/components/aside/test/basic/index.js
@@ -0,0 +1,20 @@
+import {bootstrap} from 'angular2/angular2'
+import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
+import {View} from 'angular2/src/core/annotations_impl/view';
+
+import {Aside} from 'ionic/components/aside/aside';
+
+
+@Component({
+ selector: 'ion-app'
+})
+@View({
+ directives: [Aside, Content],
+ templateUrl: 'main.html'
+})
+class IonicApp {
+}
+
+export function main() {
+ bootstrap(IonicApp);
+}
diff --git a/ionic/components/aside/test/basic/main.js b/ionic/components/aside/test/basic/main.js
deleted file mode 100644
index dbdd2a54a6..0000000000
--- a/ionic/components/aside/test/basic/main.js
+++ /dev/null
@@ -1,16 +0,0 @@
-import {Aside} from 'ionic/components/aside/aside';
-import {Content} from 'ionic/components/content/content';
-import {View, Component, bootstrap} from 'angular2/angular2';
-
-
-@Component({
- selector: '[ion-app]'
-})
-@View({
- directives: [Aside, Content],
- templateUrl: 'main.html'
-})
-class App {
-}
-
-bootstrap(App);
diff --git a/ionic/components/button/button.js b/ionic/components/button/button.js
index 90dbb482ef..d2fc55045d 100644
--- a/ionic/components/button/button.js
+++ b/ionic/components/button/button.js
@@ -1,18 +1,19 @@
-import {NgElement, Decorator} from 'angular2/angular2'
+import {NgElement} from 'angular2/angular2'
+import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
+
import {IonicComponent} from 'ionic/config/component'
-@Decorator({
+@Directive({
selector: 'button, ion-button, [ion-button],.button',
})
export class Button {
constructor(
- @NgElement() ngElement:NgElement
+ //@NgElement() ngElement:NgElement
) {
- this.domElement = ngElement.domElement
- this.config = Button.config.invoke(this)
+ //this.domElement = ngElement.domElement
}
}
-new IonicComponent(Button, {
- enhanceRawElement: true,
- propClasses: ['primary', 'secondary', 'danger', 'light', 'stable', 'dark', 'block', 'clear', 'full', 'icon']
-})
+// new IonicComponent(Button, {
+// enhanceRawElement: true,
+// propClasses: ['primary', 'secondary', 'danger', 'light', 'stable', 'dark', 'block', 'clear', 'full', 'icon']
+// })
diff --git a/ionic/components/button/test/basic/index.js b/ionic/components/button/test/basic/index.js
new file mode 100644
index 0000000000..99a51f4bfa
--- /dev/null
+++ b/ionic/components/button/test/basic/index.js
@@ -0,0 +1,19 @@
+import {bootstrap} from 'angular2/angular2'
+import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
+import {View} from 'angular2/src/core/annotations_impl/view';
+
+import {Button} from 'ionic/components/button/button'
+
+@Component({ selector: 'ion-app' })
+@View({
+ templateUrl: 'main.html',
+ directives: [Button]
+})
+class IonicApp {
+ constructor() {
+ }
+}
+
+export function main() {
+ bootstrap(IonicApp);
+}
diff --git a/ionic/components/button/test/basic/main.js b/ionic/components/button/test/basic/main.js
deleted file mode 100644
index fccc6cccec..0000000000
--- a/ionic/components/button/test/basic/main.js
+++ /dev/null
@@ -1,14 +0,0 @@
-import {Component, View, bootstrap} from 'angular2/angular2'
-import {Button} from 'ionic/components/button/button'
-
-@Component({ selector: '[ion-app]' })
-@View({
- templateUrl: 'main.html',
- directives: [Button]
-})
-class IonicApp {
- constructor() {
- }
-}
-
-bootstrap(IonicApp)
diff --git a/ionic/components/button/test/block/index.js b/ionic/components/button/test/block/index.js
new file mode 100644
index 0000000000..e6d5b28805
--- /dev/null
+++ b/ionic/components/button/test/block/index.js
@@ -0,0 +1,18 @@
+import {bootstrap} from 'angular2/angular2'
+import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
+import {View} from 'angular2/src/core/annotations_impl/view';
+
+import {Button} from 'ionic/components/button/button'
+
+
+@Component({ selector: 'ion-app' })
+@View({
+ templateUrl: 'main.html',
+ directives: [Button]
+})
+class IonicApp {}
+
+
+export function main() {
+ bootstrap(IonicApp);
+}
diff --git a/ionic/components/button/test/block/main.js b/ionic/components/button/test/block/main.js
deleted file mode 100644
index bb9e663184..0000000000
--- a/ionic/components/button/test/block/main.js
+++ /dev/null
@@ -1,12 +0,0 @@
-import {Component, View, bootstrap} from 'angular2/angular2'
-import {Button} from 'ionic/components/button/button'
-
-
-@Component({ selector: '[ion-app]' })
-@View({
- templateUrl: 'main.html',
- directives: [Button]
-})
-class IonicApp {}
-
-bootstrap(IonicApp)
diff --git a/ionic/components/button/test/clear/index.js b/ionic/components/button/test/clear/index.js
new file mode 100644
index 0000000000..e6d5b28805
--- /dev/null
+++ b/ionic/components/button/test/clear/index.js
@@ -0,0 +1,18 @@
+import {bootstrap} from 'angular2/angular2'
+import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
+import {View} from 'angular2/src/core/annotations_impl/view';
+
+import {Button} from 'ionic/components/button/button'
+
+
+@Component({ selector: 'ion-app' })
+@View({
+ templateUrl: 'main.html',
+ directives: [Button]
+})
+class IonicApp {}
+
+
+export function main() {
+ bootstrap(IonicApp);
+}
diff --git a/ionic/components/button/test/clear/main.js b/ionic/components/button/test/clear/main.js
deleted file mode 100644
index bb9e663184..0000000000
--- a/ionic/components/button/test/clear/main.js
+++ /dev/null
@@ -1,12 +0,0 @@
-import {Component, View, bootstrap} from 'angular2/angular2'
-import {Button} from 'ionic/components/button/button'
-
-
-@Component({ selector: '[ion-app]' })
-@View({
- templateUrl: 'main.html',
- directives: [Button]
-})
-class IonicApp {}
-
-bootstrap(IonicApp)
diff --git a/ionic/components/button/test/full/index.js b/ionic/components/button/test/full/index.js
new file mode 100644
index 0000000000..e6d5b28805
--- /dev/null
+++ b/ionic/components/button/test/full/index.js
@@ -0,0 +1,18 @@
+import {bootstrap} from 'angular2/angular2'
+import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
+import {View} from 'angular2/src/core/annotations_impl/view';
+
+import {Button} from 'ionic/components/button/button'
+
+
+@Component({ selector: 'ion-app' })
+@View({
+ templateUrl: 'main.html',
+ directives: [Button]
+})
+class IonicApp {}
+
+
+export function main() {
+ bootstrap(IonicApp);
+}
diff --git a/ionic/components/button/test/full/main.js b/ionic/components/button/test/full/main.js
deleted file mode 100644
index bb9e663184..0000000000
--- a/ionic/components/button/test/full/main.js
+++ /dev/null
@@ -1,12 +0,0 @@
-import {Component, View, bootstrap} from 'angular2/angular2'
-import {Button} from 'ionic/components/button/button'
-
-
-@Component({ selector: '[ion-app]' })
-@View({
- templateUrl: 'main.html',
- directives: [Button]
-})
-class IonicApp {}
-
-bootstrap(IonicApp)
diff --git a/ionic/components/button/test/icons/index.js b/ionic/components/button/test/icons/index.js
new file mode 100644
index 0000000000..e6d5b28805
--- /dev/null
+++ b/ionic/components/button/test/icons/index.js
@@ -0,0 +1,18 @@
+import {bootstrap} from 'angular2/angular2'
+import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
+import {View} from 'angular2/src/core/annotations_impl/view';
+
+import {Button} from 'ionic/components/button/button'
+
+
+@Component({ selector: 'ion-app' })
+@View({
+ templateUrl: 'main.html',
+ directives: [Button]
+})
+class IonicApp {}
+
+
+export function main() {
+ bootstrap(IonicApp);
+}
diff --git a/ionic/components/button/test/icons/main.js b/ionic/components/button/test/icons/main.js
deleted file mode 100644
index bb9e663184..0000000000
--- a/ionic/components/button/test/icons/main.js
+++ /dev/null
@@ -1,12 +0,0 @@
-import {Component, View, bootstrap} from 'angular2/angular2'
-import {Button} from 'ionic/components/button/button'
-
-
-@Component({ selector: '[ion-app]' })
-@View({
- templateUrl: 'main.html',
- directives: [Button]
-})
-class IonicApp {}
-
-bootstrap(IonicApp)
diff --git a/ionic/components/button/test/outline/index.js b/ionic/components/button/test/outline/index.js
new file mode 100644
index 0000000000..e6d5b28805
--- /dev/null
+++ b/ionic/components/button/test/outline/index.js
@@ -0,0 +1,18 @@
+import {bootstrap} from 'angular2/angular2'
+import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
+import {View} from 'angular2/src/core/annotations_impl/view';
+
+import {Button} from 'ionic/components/button/button'
+
+
+@Component({ selector: 'ion-app' })
+@View({
+ templateUrl: 'main.html',
+ directives: [Button]
+})
+class IonicApp {}
+
+
+export function main() {
+ bootstrap(IonicApp);
+}
diff --git a/ionic/components/button/test/outline/main.js b/ionic/components/button/test/outline/main.js
deleted file mode 100644
index bb9e663184..0000000000
--- a/ionic/components/button/test/outline/main.js
+++ /dev/null
@@ -1,12 +0,0 @@
-import {Component, View, bootstrap} from 'angular2/angular2'
-import {Button} from 'ionic/components/button/button'
-
-
-@Component({ selector: '[ion-app]' })
-@View({
- templateUrl: 'main.html',
- directives: [Button]
-})
-class IonicApp {}
-
-bootstrap(IonicApp)
diff --git a/ionic/components/button/test/sizes/index.js b/ionic/components/button/test/sizes/index.js
new file mode 100644
index 0000000000..e6d5b28805
--- /dev/null
+++ b/ionic/components/button/test/sizes/index.js
@@ -0,0 +1,18 @@
+import {bootstrap} from 'angular2/angular2'
+import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
+import {View} from 'angular2/src/core/annotations_impl/view';
+
+import {Button} from 'ionic/components/button/button'
+
+
+@Component({ selector: 'ion-app' })
+@View({
+ templateUrl: 'main.html',
+ directives: [Button]
+})
+class IonicApp {}
+
+
+export function main() {
+ bootstrap(IonicApp);
+}
diff --git a/ionic/components/button/test/sizes/main.js b/ionic/components/button/test/sizes/main.js
deleted file mode 100644
index bb9e663184..0000000000
--- a/ionic/components/button/test/sizes/main.js
+++ /dev/null
@@ -1,12 +0,0 @@
-import {Component, View, bootstrap} from 'angular2/angular2'
-import {Button} from 'ionic/components/button/button'
-
-
-@Component({ selector: '[ion-app]' })
-@View({
- templateUrl: 'main.html',
- directives: [Button]
-})
-class IonicApp {}
-
-bootstrap(IonicApp)
diff --git a/ionic/components/card/test/basic/index.js b/ionic/components/card/test/basic/index.js
new file mode 100644
index 0000000000..3bce804e4d
--- /dev/null
+++ b/ionic/components/card/test/basic/index.js
@@ -0,0 +1,23 @@
+import {bootstrap} from 'angular2/angular2'
+import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
+import {View} from 'angular2/src/core/annotations_impl/view';
+
+import {Content} from 'ionic/components/content/content';
+import {List} from 'ionic/components/list/list';
+
+
+@Component({ selector: 'ion-app' })
+@View({
+ templateUrl: 'main.html',
+ directives: [Content, List]
+})
+class IonicApp {
+ constructor() {
+ console.log('IonicApp Start')
+ }
+}
+
+
+export function main() {
+ bootstrap(IonicApp);
+}
diff --git a/ionic/components/card/test/basic/main.js b/ionic/components/card/test/basic/main.js
deleted file mode 100644
index eeadc37520..0000000000
--- a/ionic/components/card/test/basic/main.js
+++ /dev/null
@@ -1,17 +0,0 @@
-import {Component, View, bootstrap} from 'angular2/angular2';
-import {Content} from 'ionic/components/content/content';
-import {List} from 'ionic/components/list/list';
-
-
-@Component({ selector: '[ion-app]' })
-@View({
- templateUrl: 'main.html',
- directives: [Content, List]
-})
-class IonicApp {
- constructor() {
- console.log('IonicApp Start')
- }
-}
-
-bootstrap(IonicApp)
diff --git a/ionic/components/checkbox/test/basic/main.js b/ionic/components/checkbox/test/basic/index.js
similarity index 63%
rename from ionic/components/checkbox/test/basic/main.js
rename to ionic/components/checkbox/test/basic/index.js
index 1d618e75fe..239777718b 100644
--- a/ionic/components/checkbox/test/basic/main.js
+++ b/ionic/components/checkbox/test/basic/index.js
@@ -1,8 +1,11 @@
-import {Component, View, bootstrap} from 'angular2/angular2'
+import {bootstrap} from 'angular2/angular2'
+import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
+import {View} from 'angular2/src/core/annotations_impl/view';
+
import {FormBuilder, Validators, FormDirectives, ControlGroup} from 'angular2/forms';
import {IONIC_DIRECTIVES} from 'ionic/ionic'
-@Component({ selector: '[ion-app]' })
+@Component({ selector: 'ion-app' })
@View({
templateUrl: 'main.html',
directives: [FormDirectives].concat(IONIC_DIRECTIVES)
@@ -21,4 +24,7 @@ class IonicApp {
}
}
-bootstrap(IonicApp)
+
+export function main() {
+ bootstrap(IonicApp);
+}
diff --git a/ionic/components/content/content.js b/ionic/components/content/content.js
index dbb1a3db12..0cdd0a84e1 100644
--- a/ionic/components/content/content.js
+++ b/ionic/components/content/content.js
@@ -1,8 +1,6 @@
-import {
- NgElement,
- Component,
- View,
-} from 'angular2/angular2';
+import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
+import {View} from 'angular2/src/core/annotations_impl/view';
+
@Component({
selector: 'ion-content',
diff --git a/ionic/components/content/test/basic/main.js b/ionic/components/content/test/basic/index.js
similarity index 57%
rename from ionic/components/content/test/basic/main.js
rename to ionic/components/content/test/basic/index.js
index 7bd890f05e..e080c0eeee 100644
--- a/ionic/components/content/test/basic/main.js
+++ b/ionic/components/content/test/basic/index.js
@@ -1,10 +1,13 @@
-import {Component, View, bootstrap} from 'angular2/angular2';
+import {bootstrap} from 'angular2/angular2'
+import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
+import {View} from 'angular2/src/core/annotations_impl/view';
+
import {Content} from 'ionic/components/content/content';
import {Icon} from 'ionic/components/icon/icon';
import {Checkbox} from 'ionic/components/checkbox/checkbox';
import {List} from 'ionic/components/list/list';
-@Component({ selector: '[ion-app]' })
+@Component({ selector: 'ion-app' })
@View({
templateUrl: 'main.html',
directives: [Content, Icon, Checkbox, List]
@@ -15,4 +18,7 @@ class IonicApp {
}
}
-bootstrap(IonicApp)
+
+export function main() {
+ bootstrap(IonicApp);
+}
diff --git a/ionic/components/content/test/pull-to-refresh/main.js b/ionic/components/content/test/pull-to-refresh/index.js
similarity index 87%
rename from ionic/components/content/test/pull-to-refresh/main.js
rename to ionic/components/content/test/pull-to-refresh/index.js
index 4167073fa1..7b78e35250 100644
--- a/ionic/components/content/test/pull-to-refresh/main.js
+++ b/ionic/components/content/test/pull-to-refresh/index.js
@@ -5,7 +5,7 @@ import {Checkbox} from 'ionic/components/checkbox/checkbox';
import {List} from 'ionic/components/list/list';
import {Refresher} from 'ionic/components/scroll/pull-to-refresh';
-@Component({ selector: '[ion-app]' })
+@Component({ selector: 'ion-app' })
@View({
templateUrl: 'main.html',
directives: [Content, Icon, Checkbox, List, Refresher]
@@ -22,4 +22,7 @@ class IonicApp {
}
}
-bootstrap(IonicApp)
+
+export function main() {
+ bootstrap(IonicApp);
+}
diff --git a/ionic/components/form/form.js b/ionic/components/form/form.js
index e69de29bb2..7d6cb4908d 100644
--- a/ionic/components/form/form.js
+++ b/ionic/components/form/form.js
@@ -0,0 +1 @@
+// form
diff --git a/ionic/components/form/input/input.js b/ionic/components/form/input/input.js
index 0187b04407..eb6aebd0f1 100644
--- a/ionic/components/form/input/input.js
+++ b/ionic/components/form/input/input.js
@@ -1,17 +1,16 @@
-import {NgElement, Decorator} from 'angular2/angular2'
+import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
+
import {IonicComponent} from 'ionic/config/component'
-@Decorator({
+
+@Directive({
selector: 'ion-input'
})
export class Input {
- constructor(
- @NgElement() ngElement:NgElement
- ) {
- this.domElement = ngElement.domElement
+ constructor() {
//this.config = Button.config.invoke(this)
console.log('INPUT');
}
}
-new IonicComponent(Input, {
-})
+// new IonicComponent(Input, {
+// })
diff --git a/ionic/components/form/label/label.js b/ionic/components/form/label/label.js
index f3149743bf..7e779c0985 100644
--- a/ionic/components/form/label/label.js
+++ b/ionic/components/form/label/label.js
@@ -1,15 +1,14 @@
-import {NgElement, Decorator} from 'angular2/angular2'
+import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
+
import {IonicComponent} from 'ionic/config/component'
-@Decorator({
+
+@Directive({
selector: 'ion-label'
})
export class Label {
- constructor(
- @NgElement() ngElement:NgElement
- ) {
- this.domElement = ngElement.domElement
+ constructor() {
}
}
-new IonicComponent(Label, {
-})
+// new IonicComponent(Label, {
+// })
diff --git a/ionic/components/form/test/basic/main.js b/ionic/components/form/test/basic/index.js
similarity index 71%
rename from ionic/components/form/test/basic/main.js
rename to ionic/components/form/test/basic/index.js
index cb6daaf61d..3f1f496375 100644
--- a/ionic/components/form/test/basic/main.js
+++ b/ionic/components/form/test/basic/index.js
@@ -1,11 +1,14 @@
-import {Component, View, bootstrap} from 'angular2/angular2'
+import {bootstrap} from 'angular2/angular2'
+import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
+import {View} from 'angular2/src/core/annotations_impl/view';
+
import {FormBuilder, Validators, FormDirectives, ControlGroup} from 'angular2/forms';
//import {Button, Switch, Form, List, Label, Item, Input, Content} from 'ionic/ionic';
import {IONIC_DIRECTIVES} from 'ionic/ionic'
console.log([FormDirectives].concat(IONIC_DIRECTIVES));
-@Component({ selector: '[ion-app]' })
+@Component({ selector: 'ion-app' })
@View({
templateUrl: 'main.html',
directives: [FormDirectives].concat(IONIC_DIRECTIVES)
@@ -26,4 +29,7 @@ class IonicApp {
}
}
-bootstrap(IonicApp)
+
+export function main() {
+ bootstrap(IonicApp);
+}
diff --git a/ionic/components/icon/icon.js b/ionic/components/icon/icon.js
index 07f5b273a3..f695c376ec 100644
--- a/ionic/components/icon/icon.js
+++ b/ionic/components/icon/icon.js
@@ -1,10 +1,11 @@
-import {NgElement, Decorator} from 'angular2/angular2'
+import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
-@Decorator({
+
+@Directive({
selector: 'ion-icon,ionicon,icon'
})
export class Icon {
- constructor(@NgElement() ngEle:NgElement) {
- ngEle.domElement.setAttribute('aria-hidden', 'hidden')
+ constructor() {
+ //ngEle.domElement.setAttribute('aria-hidden', 'hidden')
}
}
diff --git a/ionic/components/item/test/basic/main.js b/ionic/components/item/test/accessories/index.js
similarity index 80%
rename from ionic/components/item/test/basic/main.js
rename to ionic/components/item/test/accessories/index.js
index 4befaff65e..c7e3dea8ea 100644
--- a/ionic/components/item/test/basic/main.js
+++ b/ionic/components/item/test/accessories/index.js
@@ -4,16 +4,18 @@ import {Item, List} from 'ionic/ionic'
import {ItemPrimarySwipeButtons} from 'ionic/components/item/item-swipe-buttons'
@Component({
- selector: '[ion-app]'
+ selector: 'ion-app'
})
@View({
templateUrl: 'main.html',
directives: [Item, List, For, ItemPrimarySwipeButtons]
})
-class App{
+class IonicApp {
constructor() {
this.items = [1, 2, 3, 4, 5]
}
}
-bootstrap(App)
+export function main() {
+ bootstrap(IonicApp);
+}
diff --git a/ionic/components/item/test/accessories/main.js b/ionic/components/item/test/basic/index.js
similarity index 50%
rename from ionic/components/item/test/accessories/main.js
rename to ionic/components/item/test/basic/index.js
index 4befaff65e..d5a513ae80 100644
--- a/ionic/components/item/test/accessories/main.js
+++ b/ionic/components/item/test/basic/index.js
@@ -1,19 +1,25 @@
-import {Component, View, For, bootstrap} from 'angular2/angular2'
+import {bootstrap} from 'angular2/angular2'
+import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
+import {View} from 'angular2/src/core/annotations_impl/view';
+
import {Item, List} from 'ionic/ionic'
import {ItemPrimarySwipeButtons} from 'ionic/components/item/item-swipe-buttons'
@Component({
- selector: '[ion-app]'
+ selector: 'ion-app'
})
@View({
templateUrl: 'main.html',
directives: [Item, List, For, ItemPrimarySwipeButtons]
})
-class App{
+class IonicApp {
constructor() {
this.items = [1, 2, 3, 4, 5]
}
}
-bootstrap(App)
+
+export function main() {
+ bootstrap(IonicApp);
+}
diff --git a/ionic/components/layout/test/basic/index.js b/ionic/components/layout/test/basic/index.js
new file mode 100644
index 0000000000..79cce2dace
--- /dev/null
+++ b/ionic/components/layout/test/basic/index.js
@@ -0,0 +1,23 @@
+import {bootstrap} from 'angular2/angular2'
+import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
+import {View} from 'angular2/src/core/annotations_impl/view';
+
+import {Content} from 'ionic/components/content/content';
+import {Layout} from 'ionic/components/layout/layout';
+
+
+@Component({ selector: 'ion-app' })
+@View({
+ templateUrl: 'main.html',
+ directives: [Content, Layout]
+})
+class IonicApp {
+ constructor() {
+ console.log('IonicApp Start')
+ }
+}
+
+
+export function main() {
+ bootstrap(IonicApp);
+}
diff --git a/ionic/components/layout/test/basic/main.js b/ionic/components/layout/test/basic/main.js
deleted file mode 100644
index 6530cfb7f7..0000000000
--- a/ionic/components/layout/test/basic/main.js
+++ /dev/null
@@ -1,17 +0,0 @@
-import {Component, View, bootstrap} from 'angular2/angular2';
-import {Content} from 'ionic/components/content/content';
-import {Layout} from 'ionic/components/layout/layout';
-
-
-@Component({ selector: '[ion-app]' })
-@View({
- templateUrl: 'main.html',
- directives: [Content, Layout]
-})
-class IonicApp {
- constructor() {
- console.log('IonicApp Start')
- }
-}
-
-bootstrap(IonicApp)
diff --git a/ionic/components/list/list.js b/ionic/components/list/list.js
index 6b9531487f..976b3a7fe3 100644
--- a/ionic/components/list/list.js
+++ b/ionic/components/list/list.js
@@ -1,4 +1,6 @@
-import {NgElement, Component, View} from 'angular2/angular2'
+import {Component, Directive} from 'angular2/src/core/annotations_impl/annotations';
+import {View} from 'angular2/src/core/annotations_impl/view';
+
import {IonicComponent} from 'ionic/config/component'
@@ -9,14 +11,11 @@ import {IonicComponent} from 'ionic/config/component'
template: `