This commit is contained in:
Andrew
2015-03-24 08:59:47 -06:00
parent 6fdc9515d6
commit 5505061977
7 changed files with 57 additions and 24 deletions

View File

@@ -2,6 +2,7 @@
// Mostly stolen from https://github.com/pkozlowski-opensource/ng2-play
/////
var Builder = require('systemjs-builder');
var gulp = require('gulp');
var karma = require('karma').server;
var path = require('path');
@@ -24,6 +25,19 @@ var argv = require('yargs').argv;
gulp.task('default', ['js', 'html', 'sass', 'libs', 'playgroundJs', 'playgroundFiles']);
var NG2_PATH = 'jspm_packages/github/angular/angular@master';
gulp.task('ng2-compile', shell.task([
'npm install',
'gulp build/transpile.js.dev.es6'
], {
cwd: NG2_PATH
}));
gulp.task('ng2-copy', ['ng2-compile'], function() {
return gulp.src(NG2_PATH + '/dist/js/dev/es6/{angular2,rtts_assert}/**/*')
.pipe(gulpif(/es6$/, rename({ extname: '.js' })))
.pipe(gulp.dest('dist/lib'));
});
gulp.task('watch', ['default'], function() {
var http = require('http');
var connect = require('connect');
@@ -82,10 +96,6 @@ gulp.task('playgroundJs', function() {
.pipe(gulp.dest(buildConfig.dist));
});
function traceurCompile() {
return lazypipe()
();
}
gulp.task('js', function () {
return gulp.src(buildConfig.src.js)
.pipe(rename(function(file) {
@@ -149,3 +159,10 @@ gulp.task('examples', ['sass'], function() {
});
require('./scripts/snapshot/snapshot.task')(gulp, argv, buildConfig);
gulp.task('watch-examples', ['examples'], function() {
return gulp.watch([
'src/**/*',
'scripts/examples/index.template.html'
], ['examples']);
});

View File

@@ -1,21 +1,36 @@
System.config({
"paths": {
"*": "*.js",
"github:*": "/jspm_packages/github/*.js"
paths: {
'*': '*.js',
'github:*': '/jspm_packages/github/*.js',
'npm:*': '/jspm_packages/npm/*.js'
},
"traceurOptions": {
"annotations": true,
"types": true,
"memberVariables": true
traceurOptions: {
sourceMaps: true,
annotations: true, // parse annotations
types: true, // parse types
script: false, // parse as a module
memberVariables: true, // parse class fields
modules: 'instantiate'
}
});
System.config({
"map": {
"angular/zone.js": "github:angular/zone.js@0.4.1",
"angular2": "github:angular/angular@master/dist/js/prod/es6/angular2",
"hammer": "github:hammerjs/hammer.js@2.0.4",
"ionic2": "/src"
map: {
'angular2': '/dist/lib/angular2',
'rtts_assert': '/dist/lib/rtts_assert',
'angular/zone.js': 'github:angular/zone.js@0.4.1',
'events': 'github:jspm/nodelibs-events@0.1.0',
'hammer': 'github:hammerjs/hammer.js@2.0.4',
'ionic2': '/src',
'github:jspm/nodelibs-events@0.1.0': {
'events-browserify': 'npm:events-browserify@0.0.1'
},
'github:jspm/nodelibs-process@0.1.1': {
'process': 'npm:process@0.10.1'
},
'npm:events-browserify@0.0.1': {
'process': 'github:jspm/nodelibs-process@0.1.1'
}
}
});

View File

@@ -28,10 +28,10 @@
"serve-static": "~1.8.1",
"systemjs": "^0.11.3",
"through2": "~0.6.3",
"yargs": "^3.6.0"
"yargs": "^3.6.0",
"systemjs-builder": "^0.9.1"
},
"dependencies": {
"angular2": "2.0.0-alpha.13",
"es6-module-loader": "~0.11.0",
"event-stream": "^3.3.0",
"gulp-template": "^3.0.0",
@@ -50,7 +50,9 @@
},
"configFile": "jspm-config.js",
"dependencies": {
"angular2": "github:angular/angular@master",
"angular/zone.js": "github:angular/zone.js@0.4.1",
"events": "github:jspm/nodelibs-events@^0.1.0",
"hammer": "github:hammerjs/hammer.js@^2.0.4"
}
}

View File

@@ -4,14 +4,13 @@
<meta charset="UTF-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no" />
<link rel="stylesheet" href="/css/ionic.css" />
<link rel="stylesheet" href="/dist/css/ionic.css" />
<script src="/jspm_packages/system.js"></script>
<script src="/jspm-config.js"></script>
<script src="https://cdn.rawgit.com/angular/zone.js/v0.4.1/zone.js"></script>
<script src="https://cdn.rawgit.com/angular/zone.js/v0.4.1/long-stack-trace-zone.js"></script>
<script src="https://cdn.rawgit.com/robwormald/50b6b855a6ce21af6967/raw/aa9e1c0eed78defd890ccfcc50c4b4648d4d891d/angular2.js"></script>
<script src="/jspm-config.js"></script>
</head>
<body>
<body ion-app>
<%= contents %>
</body>
<script>

View File

@@ -142,7 +142,6 @@ class RightAsideSlideGesture extends LeftAsideSlideGesture {
}
import Hammer from 'hammer';
class TopAsideSlideGesture extends AsideSlideGesture {
onSlide(slide, ev) {
this.aside.domElement.style.transform = 'translate3d(0,' + slide.distance + 'px,0)';

View File

@@ -33,4 +33,5 @@
<button class="button" (click)="openLeft()">
Open Left Menu
</button>
</div>
</aside-app>

View File

@@ -20,7 +20,7 @@ import {Ion} from '../ion'
</div>`,
directives: [Toolbar]
})
export class View extends Ion {
export class View {
constructor(@NgElement() ele:NgElement) {
ele.domElement.classList.add('pane')
}