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 d047783fa3..841532c0d2 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -13,34 +13,44 @@ var gulpif = require('gulp-if');
var rename = require('gulp-rename');
var sass = require('gulp-sass');
var through2 = require('through2');
-var exec = require('child_process').exec;
-var spawn = require('child_process').spawn;
var runSequence = require('run-sequence');
+var watch = require('gulp-watch');
// !!! TEMP HACK !!!
// first run ./update-angular.sh
-gulp.task('build', function(done) {
-
- if (!fs.existsSync('./dist/angular')) {
- console.error('hey yo, run "gulp update.angular" first');
- return;
- }
+gulp.task('watch', function() {
runSequence(
+ 'clean',
'ionic.copy.js',
'ionic.examples',
- 'angular.build',
- done
- );
+ '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('clean', function(done) {
+ del(['../angular/modules/ionic, ./angular/modules/examples/src/ionic'], done);
});
gulp.task('ionic.copy.js', function(done) {
- console.log('copying ionic src JS to dist/angular/modules/ionic...');
- return gulp.src('ionic/**/*.js')
- .pipe(gulp.dest('dist/angular/modules/ionic'));
+ return gulp.src(['ionic/**/*.js', '!ionic/components/*/test/**/*'])
+ .pipe(gulp.dest('../angular/modules/ionic'));
});
@@ -51,12 +61,11 @@ gulp.task('ionic.examples', function() {
// Get each test folder with gulp.src
return gulp.src('ionic/components/*/test/*/**/*')
- .pipe(cached('ionicexamples'))
.pipe(rename(function(file) {
file.dirname = file.dirname.replace(path.sep + 'test' + path.sep, path.sep)
}))
- .pipe(gulpif(/main.js$/, processMain()))
- .pipe(gulp.dest('dist/angular/modules/examples/src/ionic'))
+ .pipe(gulpif(/index.js$/, processMain()))
+ .pipe(gulp.dest('../angular/modules/examples/src/ionic'))
function processMain() {
return through2.obj(function(file, enc, next) {
@@ -73,73 +82,33 @@ gulp.task('ionic.examples', function() {
});
-gulp.task('serve', function(done) {
-
- runSequence(
- 'build',
- 'angular.serve',
- done
- );
-
-});
-
-
-gulp.task('angular.serve', function(done) {
-
- var serve = spawn('gulp', ['serve.js.dev'], {
- cwd: './dist/angular'
- });
-
- serve.stdout.on('data', function (data) {
- console.log('' + data);
- });
-
- serve.stderr.on('data', function (data) {
- console.log('' + data);
- });
-
- serve.on('close', function (code) {
- console.log('gulp serve exited with code ' + code);
- });
-
-});
-
-
-gulp.task('angular.build', function(done) {
-
- var child = exec('gulp build.js.dev', {
- cwd: './dist/angular'
- }, function (error, stdout, stderr) {
- console.log('stdout: ' + stdout);
- console.log('stderr: ' + stderr);
- if (error !== null) {
- console.log('exec error: ' + error);
- }
- done();
- });
-
+gulp.task('sass', function() {
+ return gulp.src('ionic/ionic.scss')
+ .pipe(sass({
+ onError: function(err) {
+ console.log(err)
+ }
+ }))
+ .pipe(gulp.dest('dist/css'));
});
gulp.task('update.angular', function(done) {
- if (!fs.existsSync('./dist')) {
- fs.mkdirSync('./dist');
- }
- if (!fs.existsSync('./dist/angular')) {
- fs.mkdirSync('./dist/angular');
+ if (!fs.existsSync('../angular')) {
+ fs.mkdirSync('../angular');
console.log('cloning angular master...');
- exec('git clone git@github.com:angular/angular ./dist/angular', function() {
+ exec('git clone git@github.com:angular/angular ../angular', function() {
npmInstall();
});
} else {
console.log('angular master: cleaning modules');
- del(['dist/angular/modules'], {cwd: './dist/angular'}, function() {
+ del(['../angular/modules'], function() {
console.log('angular master: reset --hard...');
- exec('git reset --hard origin/master', {cwd: './dist/angular'}, function () {
+ exec('git reset --hard origin/master', {cwd: '../angular'}, function () {
console.log('angular master: git pull origin master...');
exec('git pull origin master', function () {
@@ -152,7 +121,7 @@ gulp.task('update.angular', function(done) {
function npmInstall() {
console.log('angular master: npm install (may take a while, chill out)...');
- exec('npm install', {cwd: './dist/angular'}, function () {
+ exec('npm install', {cwd: '../angular'}, function () {
done();
});
}
@@ -161,25 +130,20 @@ gulp.task('update.angular', function(done) {
-
require('./scripts/snapshot/snapshot.task')(gulp, argv, buildConfig);
-gulp.task('default', ['clean'], function() {
- gulp.run('build');
-});
-
-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('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' })
@@ -189,26 +153,12 @@ gulp.task('karma-watch', function() {
return karma.start({ configFile: __dirname + '/scripts/test/karma-watch.conf.js' })
});
-gulp.task('sass', function() {
- return gulp.src('ionic/ionic.scss')
- .pipe(sass({
- onError: function(err) {
- console.log(err)
- }
- }))
- .pipe(gulp.dest('dist/css'));
-});
-
gulp.task('fonts', function() {
return gulp.src('ionic/components/icon/fonts/**/*')
.pipe(gulp.dest('dist/fonts'));
});
-gulp.task('clean', function(done) {
- del(['dist/e2e'], done);
-});
-
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/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/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: `