diff --git a/gulpfile.js b/gulpfile.js index e565a233fc..760f9e28b8 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -98,16 +98,16 @@ gulp.task('e2e', ['ionic-js', 'sass'], function() { .pipe(rename(function(file) { file.dirname = file.dirname.replace(path.sep + 'test' + path.sep, path.sep) })) - .pipe(gulpif(/main.html$/, processMainHtml())) + .pipe(gulpif(/main.js$/, processMain())) .pipe(gulpif(/e2e.js$/, createPlatformTests())) .pipe(gulp.dest(buildConfig.dist + '/e2e')) - function processMainHtml() { + function processMain() { return through2.obj(function(file, enc, next) { this.push(new VinylFile({ base: file.base, contents: new Buffer(indexContents), - path: file.path.replace(/main.html$/, 'index.html'), + path: file.path.replace(/main.js$/, 'index.html'), })) next(null, file) }) diff --git a/src/components.js b/src/components.js index 69912a0541..5aa7726f0e 100644 --- a/src/components.js +++ b/src/components.js @@ -10,5 +10,6 @@ export * from 'ionic2/components/list/list' export * from 'ionic2/components/nav-view/nav-view' export * from 'ionic2/components/nav-viewport/nav-viewport' export * from 'ionic2/components/tabs/tabs' +export * from 'ionic2/components/tabs/tab' export * from 'ionic2/components/toolbar/toolbar' export * from 'ionic2/components/view/view' diff --git a/src/components/nav-view/nav-view.js b/src/components/nav-view/nav-view.js index 67e2228949..1a89bb127e 100644 --- a/src/components/nav-view/nav-view.js +++ b/src/components/nav-view/nav-view.js @@ -1,5 +1,6 @@ -import {DynamicComponent, Parent, NgElement} from 'angular2/angular2' -import {NavViewport} from 'ionic2/components' +import {DynamicComponent, Ancestor, NgElement} from 'angular2/angular2' +import {Optional} from 'angular2/src/di/annotations' +import {NavViewport, Tabs} from 'ionic2/components' import {PrivateComponentLoader} from 'angular2/src/core/compiler/private_component_loader' import {PrivateComponentLocation} from 'angular2/src/core/compiler/private_component_location' @@ -13,12 +14,15 @@ export class NavView { constructor( loader: PrivateComponentLoader, location: PrivateComponentLocation, - @Parent() viewport: NavViewport, - @NgElement() element: NgElement + @NgElement() element: NgElement, + + // FIXME: this is temporary until ng2 lets us inject tabs as a NavViewport + @Optional() @Ancestor() viewportNav: NavViewport, + @Optional() @Ancestor() viewportTabs: Tabs ) { this.loader = loader this.location = location - this.viewport = viewport + this.viewport = viewportTabs || viewportNav this.domElement = element.domElement } diff --git a/src/components/nav-view/nav-view.scss b/src/components/nav-view/nav-view.scss index f264fd7ffc..c32fb15afb 100644 --- a/src/components/nav-view/nav-view.scss +++ b/src/components/nav-view/nav-view.scss @@ -1,3 +1,9 @@ +.nav-viewport { + flex: 1; + position: relative; + display: flex; +} + .nav-view { position: absolute; top: 0; diff --git a/src/components/nav-viewport/nav-viewport.js b/src/components/nav-viewport/nav-viewport.js index eead0660d7..959785066b 100644 --- a/src/components/nav-viewport/nav-viewport.js +++ b/src/components/nav-viewport/nav-viewport.js @@ -1,33 +1,41 @@ -import {Component, Template, For} from 'angular2/angular2' +import {Component, Template, For, NgElement} from 'angular2/angular2' import {ComponentConfig} from 'ionic2/config/component-config' import {NavView} from 'ionic2/components/nav-view/nav-view' -import {array as arrayUtil, dom as domUtil} from 'ionic2/util' +import {array as arrayUtil, dom as domUtil, isFunction} from 'ionic2/util' @Component({ selector: 'ion-nav-viewport', bind: { - initialComponent: 'initialComponent' + initial: 'initial' }, }) @Template({ inline: ` -