mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
update angular again
This commit is contained in:
13
gulpfile.js
13
gulpfile.js
@ -75,7 +75,7 @@ gulp.task('clean', function(done) {
|
|||||||
del([buildConfig.dist], done)
|
del([buildConfig.dist], done)
|
||||||
})
|
})
|
||||||
|
|
||||||
gulp.task('e2e', ['ionic-js', 'sass'], function() {
|
gulp.task('e2e', ['ionic-js', 'sass', 'ng2-copy'], function() {
|
||||||
var indexContents = _.template( fs.readFileSync('scripts/e2e/index.template.html') )({
|
var indexContents = _.template( fs.readFileSync('scripts/e2e/index.template.html') )({
|
||||||
buildConfig: buildConfig
|
buildConfig: buildConfig
|
||||||
});
|
});
|
||||||
@ -118,9 +118,11 @@ gulp.task('e2e', ['ionic-js', 'sass'], function() {
|
|||||||
'ionic/ionic': { build: false },
|
'ionic/ionic': { build: false },
|
||||||
},
|
},
|
||||||
map: {
|
map: {
|
||||||
hammer: 'node_modules/hammerjs/hammer'
|
hammer: 'node_modules/hammerjs/hammer',
|
||||||
|
rx: 'node_modules/rx'
|
||||||
},
|
},
|
||||||
paths: {
|
paths: {
|
||||||
|
'angular2/*': 'dist/lib/angular2/*.js',
|
||||||
'app/*': path.dirname(file.path) + '/*.js'
|
'app/*': path.dirname(file.path) + '/*.js'
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@ -162,7 +164,12 @@ gulp.task('e2e', ['ionic-js', 'sass'], function() {
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
gulp.task('ng2', ['lib'], 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({
|
var builder = new SystemJsBuilder({
|
||||||
paths: {
|
paths: {
|
||||||
"angular2/*": "node_modules/angular2/es6/prod/*.es6",
|
"angular2/*": "node_modules/angular2/es6/prod/*.es6",
|
||||||
|
@ -176,3 +176,5 @@ class IonicApp {
|
|||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bootstrap(IonicApp);
|
||||||
|
@ -10,7 +10,7 @@ import {IonicComponent} from 'ionic/config/component'
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-aside',
|
selector: 'ion-aside',
|
||||||
bind: {
|
properties: {
|
||||||
content: 'content',
|
content: 'content',
|
||||||
side: 'side',
|
side: 'side',
|
||||||
dragThreshold: 'dragThreshold'
|
dragThreshold: 'dragThreshold'
|
||||||
@ -63,7 +63,7 @@ export class Aside {
|
|||||||
}
|
}
|
||||||
|
|
||||||
new IonicComponent(Aside, {
|
new IonicComponent(Aside, {
|
||||||
bind: {
|
properties: {
|
||||||
side: {
|
side: {
|
||||||
value: 'left'
|
value: 'left'
|
||||||
},
|
},
|
||||||
|
@ -4,7 +4,7 @@ import {IonicComponent} from 'ionic/config/component'
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-checkbox',
|
selector: 'ion-checkbox',
|
||||||
bind: {
|
properties: {
|
||||||
checked: 'checked'
|
checked: 'checked'
|
||||||
},
|
},
|
||||||
events: {
|
events: {
|
||||||
@ -66,7 +66,7 @@ export class Checkbox {
|
|||||||
}
|
}
|
||||||
|
|
||||||
new IonicComponent(Checkbox, {
|
new IonicComponent(Checkbox, {
|
||||||
bind: {
|
properties: {
|
||||||
iconOff: {
|
iconOff: {
|
||||||
defaults: {
|
defaults: {
|
||||||
ios: 'ion-ios-circle-outline',
|
ios: 'ion-ios-circle-outline',
|
||||||
|
@ -3,22 +3,24 @@ import {
|
|||||||
Parent,
|
Parent,
|
||||||
NgElement,
|
NgElement,
|
||||||
DynamicComponentLoader,
|
DynamicComponentLoader,
|
||||||
DynamicComponentLocation,
|
ElementRef
|
||||||
Optional
|
|
||||||
} from 'angular2/angular2'
|
} from 'angular2/angular2'
|
||||||
|
import {Optional} from 'angular2/src/di/annotations'
|
||||||
import {NavViewport} from 'ionic/components/nav-viewport/nav-viewport'
|
import {NavViewport} from 'ionic/components/nav-viewport/nav-viewport'
|
||||||
import {Tab} from 'ionic/components/tabs/tab'
|
import {Tab} from 'ionic/components/tabs/tab'
|
||||||
|
|
||||||
|
console.log('names',DynamicComponent.name, Parent.name, NgElement.name, DynamicComponentLoader.name, ElementRef, Optional)
|
||||||
|
|
||||||
@DynamicComponent({
|
@DynamicComponent({
|
||||||
selector: '.nav-pane',
|
selector: '.nav-pane',
|
||||||
bind: {
|
properties: {
|
||||||
item: 'item'
|
item: 'item'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
export class NavPane {
|
export class NavPane {
|
||||||
constructor(
|
constructor(
|
||||||
loader: DynamicComponentLoader,
|
loader: DynamicComponentLoader,
|
||||||
location: DynamicComponentLocation,
|
location: ElementRef,
|
||||||
@NgElement() element: NgElement,
|
@NgElement() element: NgElement,
|
||||||
|
|
||||||
// FIXME: this is temporary until ng2 lets us inject tabs as a NavViewport
|
// FIXME: this is temporary until ng2 lets us inject tabs as a NavViewport
|
||||||
@ -36,7 +38,7 @@ export class NavPane {
|
|||||||
this.initialized = true;
|
this.initialized = true;
|
||||||
this.Class = navItem.Class;
|
this.Class = navItem.Class;
|
||||||
|
|
||||||
this._loader.load(navItem.Class, this._location).then(instance => {
|
this._loader.loadIntoExistingLocation(navItem.Class, this._location).then(instance => {
|
||||||
this.instance = instance
|
this.instance = instance
|
||||||
navItem.finishSetup(this, instance)
|
navItem.finishSetup(this, instance)
|
||||||
})
|
})
|
||||||
|
@ -22,7 +22,7 @@ class NavStack {
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-nav-viewport',
|
selector: 'ion-nav-viewport',
|
||||||
bind: {
|
properties: {
|
||||||
initial: 'initial'
|
initial: 'initial'
|
||||||
},
|
},
|
||||||
services: [
|
services: [
|
||||||
|
@ -4,7 +4,7 @@ import {IonicComponent} from 'ionic/config/component'
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-search-bar',
|
selector: 'ion-search-bar',
|
||||||
bind: {
|
properties: {
|
||||||
cancelText: 'cancel-text',
|
cancelText: 'cancel-text',
|
||||||
placeholderText: 'placeholder-text'
|
placeholderText: 'placeholder-text'
|
||||||
}
|
}
|
||||||
@ -25,7 +25,7 @@ export class SearchBar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
new IonicComponent(SearchBar, {
|
new IonicComponent(SearchBar, {
|
||||||
bind: {
|
properties: {
|
||||||
cancelText: {
|
cancelText: {
|
||||||
defaults: {
|
defaults: {
|
||||||
ios: 'Cancel',
|
ios: 'Cancel',
|
||||||
|
@ -24,7 +24,7 @@ class SplitViewportDecorator {
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-split-view',
|
selector: 'ion-split-view',
|
||||||
bind: {
|
properties: {
|
||||||
defaultView: 'defaultView',
|
defaultView: 'defaultView',
|
||||||
navTitle: 'navTitle'
|
navTitle: 'navTitle'
|
||||||
},
|
},
|
||||||
|
@ -4,7 +4,7 @@ import {IonicComponent} from 'ionic/config/component'
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-switch',
|
selector: 'ion-switch',
|
||||||
bind: {
|
properties: {
|
||||||
checked: 'checked'
|
checked: 'checked'
|
||||||
},
|
},
|
||||||
events: {
|
events: {
|
||||||
|
@ -15,7 +15,7 @@ import {IonicComponent} from 'ionic/config/component'
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-tab',
|
selector: 'ion-tab',
|
||||||
bind: {
|
properties: {
|
||||||
title: 'tab-title',
|
title: 'tab-title',
|
||||||
icon: 'tab-icon',
|
icon: 'tab-icon',
|
||||||
initial: 'initial'
|
initial: 'initial'
|
||||||
|
@ -3,7 +3,7 @@ import {IonicComponent} from 'ionic/config/component'
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-tabs',
|
selector: 'ion-tabs',
|
||||||
bind: {
|
properties: {
|
||||||
tabBarPlacement: 'tab-bar-placement',
|
tabBarPlacement: 'tab-bar-placement',
|
||||||
tabBarIcons: 'tab-bar-icons'
|
tabBarIcons: 'tab-bar-icons'
|
||||||
}
|
}
|
||||||
@ -74,7 +74,7 @@ export class Tabs {
|
|||||||
}
|
}
|
||||||
|
|
||||||
new IonicComponent(Tabs, {
|
new IonicComponent(Tabs, {
|
||||||
bind: {
|
properties: {
|
||||||
tabBarPlacement: {
|
tabBarPlacement: {
|
||||||
defaults: {
|
defaults: {
|
||||||
ios: 'bottom',
|
ios: 'bottom',
|
||||||
|
@ -25,7 +25,7 @@ export class BackButton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
new IonicComponent(BackButton, {
|
new IonicComponent(BackButton, {
|
||||||
bind: {
|
properties: {
|
||||||
icon: {
|
icon: {
|
||||||
defaults: {
|
defaults: {
|
||||||
ios: 'ion-ios-arrow-back',
|
ios: 'ion-ios-arrow-back',
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
import {NgElement, Component, View as NgView, Ancestor} from 'angular2/angular2'
|
import {NgElement, Component, View as NgView, Ancestor, Optional} from 'angular2/angular2'
|
||||||
import {Optional} from 'angular2/src/di/annotations'
|
|
||||||
import {BackButton} from 'ionic/components/toolbar/back-button'
|
import {BackButton} from 'ionic/components/toolbar/back-button'
|
||||||
import {IonicComponent} from 'ionic/config/component'
|
import {IonicComponent} from 'ionic/config/component'
|
||||||
import {raf} from 'ionic/util/dom'
|
import {raf} from 'ionic/util/dom'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-toolbar',
|
selector: 'ion-toolbar',
|
||||||
bind: {
|
properties: {
|
||||||
title: 'nav-title'
|
title: 'nav-title'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -5,7 +5,7 @@ import {IonicComponent} from 'ionic/config/component'
|
|||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-view',
|
selector: 'ion-view',
|
||||||
bind: {
|
properties: {
|
||||||
title: 'nav-title'
|
title: 'nav-title'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -106,7 +106,7 @@ export class IonicComponent {
|
|||||||
/*
|
/*
|
||||||
@IonicComponent({
|
@IonicComponent({
|
||||||
selector: 'ion-back-button',
|
selector: 'ion-back-button',
|
||||||
bind: {
|
properties: {
|
||||||
icon: {
|
icon: {
|
||||||
ios: 'ion-back-ios',
|
ios: 'ion-back-ios',
|
||||||
android: 'ion-back-android',
|
android: 'ion-back-android',
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
import {NgElement} from 'angular2/angular2'
|
||||||
|
Object.defineProperties(NgElement.prototype, {
|
||||||
|
domElement: {
|
||||||
|
get: function() {
|
||||||
|
return this._view.render.delegate.boundElements[this._boundElementIndex];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
export * from 'ionic/components'
|
export * from 'ionic/components'
|
||||||
export * from 'ionic/platform/platform'
|
export * from 'ionic/platform/platform'
|
||||||
|
Reference in New Issue
Block a user