This commit is contained in:
Adam Bradley
2015-08-07 10:50:41 -05:00
parent 898160cca2
commit 13cd3da6b2
27 changed files with 43754 additions and 1846 deletions

View File

@ -1,4 +1,4 @@
import {Directive, ElementRef, Optional, Ancestor, onDestroy, NgZone, Query, QueryList} from 'angular2/angular2'; import {Directive, ElementRef, Optional, Host, onDestroy, NgZone, Query, QueryList} from 'angular2/angular2';
import {Icon} from '../icon/icon'; import {Icon} from '../icon/icon';
import {IonicConfig} from '../../config/config'; import {IonicConfig} from '../../config/config';
@ -50,7 +50,7 @@ export class TapClick {
elementRef: ElementRef, elementRef: ElementRef,
config: IonicConfig, config: IonicConfig,
ngZone: NgZone, ngZone: NgZone,
@Optional() @Ancestor() tapDisabled: TapDisabled @Optional() @Host() tapDisabled: TapDisabled
) { ) {
this.ele = elementRef.nativeElement; this.ele = elementRef.nativeElement;
this.tapEnabled = !tapDisabled; this.tapEnabled = !tapDisabled;

View File

@ -1,4 +1,4 @@
import {Component, Directive, View, Ancestor, ElementRef, forwardRef} from 'angular2/angular2'; import {Component, Directive, View, Host, ElementRef, forwardRef} from 'angular2/angular2';
import {IonicConfig} from '../../config/config'; import {IonicConfig} from '../../config/config';
import * as dom from '../../util/dom'; import * as dom from '../../util/dom';
@ -75,7 +75,7 @@ export class FocusHolder {
} }
}) })
class FocusInput { class FocusInput {
constructor(elementRef: ElementRef, @Ancestor() holder: FocusHolder) { constructor(elementRef: ElementRef, @Host() holder: FocusHolder) {
this.elementRef = elementRef; this.elementRef = elementRef;
holder.register(this); holder.register(this);
this.holder = holder; this.holder = holder;

View File

@ -1,4 +1,4 @@
import {Directive, Ancestor, Optional} from 'angular2/angular2'; import {Directive, Host, Optional} from 'angular2/angular2';
import {IonicConfig} from '../../config/config'; import {IonicConfig} from '../../config/config';
import * as dom from '../../util/dom'; import * as dom from '../../util/dom';
@ -21,10 +21,10 @@ import {Switch} from '../switch/switch';
}) })
export class Label { export class Label {
constructor( constructor(
@Optional() @Ancestor() textContainer: Input, @Optional() @Host() textContainer: Input,
@Optional() @Ancestor() checkboxContainer: Checkbox, @Optional() @Host() checkboxContainer: Checkbox,
@Optional() @Ancestor() radioContainer: RadioButton, @Optional() @Host() radioContainer: RadioButton,
@Optional() @Ancestor() switchContainer: Switch, @Optional() @Host() switchContainer: Switch,
config: IonicConfig config: IonicConfig
) { ) {
this.container = textContainer || checkboxContainer || radioContainer || switchContainer; this.container = textContainer || checkboxContainer || radioContainer || switchContainer;

View File

@ -1,4 +1,4 @@
import {Ancestor, Optional, ElementRef, Attribute, Directive} from 'angular2/angular2'; import {Host, Optional, ElementRef, Attribute, Directive} from 'angular2/angular2';
import {IonInput} from './input'; import {IonInput} from './input';
import {IonicApp} from '../app/app'; import {IonicApp} from '../app/app';
@ -24,9 +24,9 @@ import {RadioButton} from '../radio/radio';
}) })
export class TapInput extends IonInput { export class TapInput extends IonInput {
constructor( constructor(
@Optional() @Ancestor() checkboxContainer: Checkbox, @Optional() @Host() checkboxContainer: Checkbox,
@Optional() @Ancestor() radioContainer: RadioButton, @Optional() @Host() radioContainer: RadioButton,
@Optional() @Ancestor() scrollView: Content, @Optional() @Host() scrollView: Content,
@Attribute('type') type: string, @Attribute('type') type: string,
elementRef: ElementRef, elementRef: ElementRef,
app: IonicApp, app: IonicApp,

View File

@ -1,4 +1,4 @@
import {Directive, View, Ancestor, Optional, ElementRef, Attribute, forwardRef} from 'angular2/angular2'; import {Directive, View, Host, Optional, ElementRef, Attribute, forwardRef} from 'angular2/angular2';
import {IonicDirective} from '../../config/annotations'; import {IonicDirective} from '../../config/annotations';
import {IonicConfig} from '../../config/config'; import {IonicConfig} from '../../config/config';
@ -51,8 +51,8 @@ export class Input extends IonInputItem {
}) })
export class TextInput extends IonInput { export class TextInput extends IonInput {
constructor( constructor(
@Optional() @Ancestor() container: Input, @Optional() @Host() container: Input,
@Optional() @Ancestor() scrollView: Content, @Optional() @Host() scrollView: Content,
@Attribute('type') type: string, @Attribute('type') type: string,
elementRef: ElementRef, elementRef: ElementRef,
app: IonicApp, app: IonicApp,

View File

@ -1,4 +1,4 @@
import {Directive, View, CSSClass, ElementRef, Optional, Ancestor, Attribute, Renderer} from 'angular2/angular2'; import {Directive, View, CSSClass, ElementRef, Optional, Host, Attribute, Renderer} from 'angular2/angular2';
import {IonicConfig} from '../../config/config'; import {IonicConfig} from '../../config/config';
import {IonicComponent} from '../../config/annotations'; import {IonicComponent} from '../../config/annotations';
@ -66,7 +66,7 @@ Custom Font Icon
export class IconDirective { export class IconDirective {
constructor( constructor(
private _elementRef: ElementRef, private _elementRef: ElementRef,
@Optional() @Ancestor() AncestorButton: Button, @Optional() @Host() hostButton: Button,
@Attribute('forward') forward: string, @Attribute('forward') forward: string,
config: IonicConfig, config: IonicConfig,
private renderer: Renderer private renderer: Renderer
@ -80,7 +80,7 @@ export class IconDirective {
this.fwdIcon = config.setting('forwardIcon'); this.fwdIcon = config.setting('forwardIcon');
} }
if (AncestorButton) { if (hostButton) {
// this icon is within a button // this icon is within a button
this.withinButton = true; this.withinButton = true;
@ -98,7 +98,7 @@ export class IconDirective {
// tell the button there's a child icon // tell the button there's a child icon
// the button will set the correct css classes on itself // the button will set the correct css classes on itself
AncestorButton.registerIcon(this); hostButton.registerIcon(this);
} }
} }

View File

@ -1,4 +1,4 @@
import {ElementRef, Ancestor, Directive} from 'angular2/angular2'; import {ElementRef, Host, Directive} from 'angular2/angular2';
import {Item} from 'ionic/components/item/item'; import {Item} from 'ionic/components/item/item';
import {SlideGesture} from 'ionic/gestures/slide-gesture'; import {SlideGesture} from 'ionic/gestures/slide-gesture';
@ -10,21 +10,21 @@ import {SlideGesture} from 'ionic/gestures/slide-gesture';
export class ItemPrimarySwipeButtons { export class ItemPrimarySwipeButtons {
constructor( constructor(
elementRef: ElementRef, elementRef: ElementRef,
@Ancestor() item: Item @Host() item: Item
) { ) {
item.primarySwipeButtons = this item.primarySwipeButtons = this;
this.ele = elementRef.nativeElement this.ele = elementRef.nativeElement;
this.AncestorItem = item this.item = item;
this.gesture = new ItemSlideGesture(this) this.gesture = new ItemSlideGesture(this);
this.gesture.listen() this.gesture.listen();
} }
setOpen(isOpen) { setOpen(isOpen) {
if (isOpen !== this.isOpen) { if (isOpen !== this.isOpen) {
this.isOpen = isOpen this.isOpen = isOpen;
requestAnimationFrame(() => { requestAnimationFrame(() => {
this.ele.classList[isOpen?'add':'remove'](isOpen) this.ele.classList[isOpen?'add':'remove'](isOpen);
}) });
} }
} }
} }
@ -37,7 +37,7 @@ export class ItemSecondarySwipeButtons {
class ItemSlideGesture extends SlideGesture { class ItemSlideGesture extends SlideGesture {
constructor(buttons) { constructor(buttons) {
super(buttons.AncestorItem.ele) super(buttons.item.ele)
this.buttons = buttons this.buttons = buttons
} }

View File

@ -1,5 +1,5 @@
import {ProtoViewRef, ViewContainerRef} from 'angular2/angular2' import {ProtoViewRef, ViewContainerRef} from 'angular2/angular2'
import {Directive, Ancestor, forwardRef} from 'angular2/angular2'; import {Directive, Host, forwardRef} from 'angular2/angular2';
import {App, List} from 'ionic/ionic'; import {App, List} from 'ionic/ionic';
@ -31,7 +31,7 @@ class IonicApp {
selector: 'template[cell]' selector: 'template[cell]'
}) })
export class ItemCellTemplate { export class ItemCellTemplate {
constructor(@Ancestor() list: List, viewContainer: ViewContainerRef, protoViewRef: ProtoViewRef) { constructor(@Host() list: List, viewContainer: ViewContainerRef, protoViewRef: ProtoViewRef) {
console.log('Item cell template', list, viewContainer, protoViewRef); console.log('Item cell template', list, viewContainer, protoViewRef);
this.protoViewRef = protoViewRef; this.protoViewRef = protoViewRef;

View File

@ -1,4 +1,4 @@
import {Directive, View, Ancestor, Optional, ElementRef, forwardRef} from 'angular2/angular2'; import {Directive, View, Host, Optional, ElementRef, forwardRef} from 'angular2/angular2';
import {ProtoViewRef} from 'angular2/src/core/compiler/view_ref'; import {ProtoViewRef} from 'angular2/src/core/compiler/view_ref';
import {TemplateRef} from 'angular2/angular2'; import {TemplateRef} from 'angular2/angular2';
@ -90,7 +90,7 @@ export class Navbar extends ToolbarBase {
} }
}) })
class BackButton { class BackButton {
constructor(@Ancestor() navbar: Navbar, @Optional() item: ViewItem, elementRef: ElementRef) { constructor(@Host() navbar: Navbar, @Optional() item: ViewItem, elementRef: ElementRef) {
this.item = item; this.item = item;
navbar.backButtonElement(elementRef); navbar.backButtonElement(elementRef);
} }
@ -106,7 +106,7 @@ class BackButton {
selector: '.back-button-text' selector: '.back-button-text'
}) })
class BackButtonText { class BackButtonText {
constructor(@Ancestor() navbar: Navbar, elementRef: ElementRef) { constructor(@Host() navbar: Navbar, elementRef: ElementRef) {
navbar.backButtonTextElement(elementRef); navbar.backButtonTextElement(elementRef);
} }
} }
@ -115,7 +115,7 @@ class BackButtonText {
selector: '.toolbar-title' selector: '.toolbar-title'
}) })
class Title { class Title {
constructor(@Ancestor() toolbar: Navbar, elementRef: ElementRef) { constructor(@Host() toolbar: Navbar, elementRef: ElementRef) {
toolbar.titleElement(elementRef); toolbar.titleElement(elementRef);
} }
} }
@ -124,7 +124,7 @@ class Title {
selector: '.toolbar-item' selector: '.toolbar-item'
}) })
class NavbarItem { class NavbarItem {
constructor(@Ancestor() toolbar: Navbar, elementRef: ElementRef) { constructor(@Host() toolbar: Navbar, elementRef: ElementRef) {
toolbar.itemElements(elementRef); toolbar.itemElements(elementRef);
} }
} }

View File

@ -1,4 +1,4 @@
import {Component, View, Directive, Ancestor, ElementRef, forwardRef, Inject} from 'angular2/angular2'; import {Component, View, Directive, Host, ElementRef, forwardRef, Inject} from 'angular2/angular2';
import {ViewContainerRef} from 'angular2/src/core/compiler/view_container_ref'; import {ViewContainerRef} from 'angular2/src/core/compiler/view_container_ref';
import {Pane} from './pane'; import {Pane} from './pane';
@ -8,7 +8,7 @@ import {ViewController} from '../view/view-controller';
@Directive({selector: 'template[pane-anchor]'}) @Directive({selector: 'template[pane-anchor]'})
export class PaneAnchor { export class PaneAnchor {
constructor( constructor(
@Ancestor() @Inject(forwardRef(() => Pane)) pane: Pane, @Host() @Inject(forwardRef(() => Pane)) pane: Pane,
elementRef: ElementRef elementRef: ElementRef
) { ) {
pane.sectionAnchorElementRef = elementRef; pane.sectionAnchorElementRef = elementRef;
@ -19,7 +19,7 @@ export class PaneAnchor {
@Directive({selector: 'template[content-anchor]'}) @Directive({selector: 'template[content-anchor]'})
export class PaneContentAnchor { export class PaneContentAnchor {
constructor( constructor(
@Ancestor() @Inject(forwardRef(() => Pane)) pane: Pane, @Host() @Inject(forwardRef(() => Pane)) pane: Pane,
viewContainerRef: ViewContainerRef viewContainerRef: ViewContainerRef
) { ) {
pane.contentContainerRef = viewContainerRef; pane.contentContainerRef = viewContainerRef;

View File

@ -1,4 +1,4 @@
import {Directive, View, ElementRef, Ancestor, Optional, forwardRef, Injector} from 'angular2/angular2'; import {Directive, View, ElementRef, Host, Optional, forwardRef, Injector} from 'angular2/angular2';
import {IonicComponent} from '../../config/annotations'; import {IonicComponent} from '../../config/annotations';
import {ViewController} from '../view/view-controller'; import {ViewController} from '../view/view-controller';
@ -20,11 +20,11 @@ import {ViewController} from '../view/view-controller';
export class Nav extends ViewController { export class Nav extends ViewController {
constructor( constructor(
@Optional() ancestorViewCtrl: ViewController, @Optional() hostViewCtrl: ViewController,
injector: Injector, injector: Injector,
elementRef: ElementRef elementRef: ElementRef
) { ) {
super(ancestorViewCtrl, injector, elementRef); super(hostViewCtrl, injector, elementRef);
} }
onIonInit() { onIonInit() {
@ -43,7 +43,7 @@ export class Nav extends ViewController {
@Directive({selector: 'template[pane-anchor]'}) @Directive({selector: 'template[pane-anchor]'})
class NavPaneAnchor { class NavPaneAnchor {
constructor(@Ancestor() nav: Nav, elementRef: ElementRef) { constructor(@Host() nav: Nav, elementRef: ElementRef) {
nav.anchorElementRef(elementRef); nav.anchorElementRef(elementRef);
} }
} }

View File

@ -1,4 +1,4 @@
import {ElementRef, Directive, Ancestor, Optional, Inject, forwardRef, NgZone} from 'angular2/angular2'; import {ElementRef, Directive, Host, Optional, Inject, forwardRef, NgZone} from 'angular2/angular2';
import {ViewController} from '../view/view-controller'; import {ViewController} from '../view/view-controller';
import {Pane} from './pane'; import {Pane} from './pane';
@ -14,7 +14,7 @@ import {Gesture} from 'ionic/gestures/gesture';
export class SwipeHandle { export class SwipeHandle {
constructor( constructor(
@Optional() @Inject(forwardRef(() => ViewController)) viewCtrl: ViewController, @Optional() @Inject(forwardRef(() => ViewController)) viewCtrl: ViewController,
@Ancestor() @Inject(forwardRef(() => Pane)) pane: Pane, @Host() @Inject(forwardRef(() => Pane)) pane: Pane,
elementRef: ElementRef, elementRef: ElementRef,
ngZone: NgZone ngZone: NgZone
) { ) {

View File

@ -5,7 +5,6 @@ import {
bootstrap, bootstrap,
Injectable, Injectable,
Inject, Inject,
Ancestor,
forwardRef, forwardRef,
Inject, Inject,
DynamicComponentLoader, DynamicComponentLoader,

View File

@ -1,4 +1,4 @@
import {ElementRef, Ancestor, Optional, NgControl, Query, QueryList} from 'angular2/angular2'; import {ElementRef, Host, Optional, NgControl, Query, QueryList} from 'angular2/angular2';
import {IonicDirective, IonicComponent, IonicView} from '../../config/annotations'; import {IonicDirective, IonicComponent, IonicView} from '../../config/annotations';
import {IonicConfig} from '../../config/config'; import {IonicConfig} from '../../config/config';
@ -111,7 +111,7 @@ export class RadioGroup extends Ion {
}) })
export class RadioButton extends IonInputItem { export class RadioButton extends IonInputItem {
constructor( constructor(
@Ancestor() @Optional() group: RadioGroup, @Host() @Optional() group: RadioGroup,
elementRef: ElementRef, elementRef: ElementRef,
config: IonicConfig, config: IonicConfig,
tapClick: TapClick tapClick: TapClick

View File

@ -1,4 +1,4 @@
import {Component, View, NgIf, CSSClass, ElementRef, EventEmitter, Ancestor, onInit} from 'angular2/angular2' import {Component, View, NgIf, CSSClass, ElementRef, EventEmitter, Host} from 'angular2/angular2'
import {Content} from '../content/content'; import {Content} from '../content/content';
@ -20,8 +20,7 @@ import {raf, ready, CSS} from 'ionic/util/dom';
'[class.active]': 'isActive', '[class.active]': 'isActive',
'[class.refreshing]': 'isRefreshing', '[class.refreshing]': 'isRefreshing',
'[class.refreshingTail]': 'isRefreshingTail' '[class.refreshingTail]': 'isRefreshingTail'
}, }
lifecycle: [onInit]
}) })
@View({ @View({
template: `<div class="refresher-content" [class.refresher-with-text]="pullingText || refreshingText"> template: `<div class="refresher-content" [class.refresher-with-text]="pullingText || refreshingText">
@ -39,7 +38,7 @@ import {raf, ready, CSS} from 'ionic/util/dom';
}) })
export class Refresher { export class Refresher {
constructor( constructor(
@Ancestor() content: Content, @Host() content: Content,
element: ElementRef element: ElementRef
) { ) {
this.ele = element.nativeElement; this.ele = element.nativeElement;
@ -71,7 +70,7 @@ export class Refresher {
this.startY = null; this.startY = null;
this.deltaY = null; this.deltaY = null;
this.canOverscroll = true; this.canOverscroll = true;
this.scrollAncestor = sp; this.scrollHost = sp;
this.scrollChild = sc; this.scrollChild = sc;
util.defaults(this, { util.defaults(this, {
@ -248,7 +247,7 @@ export class Refresher {
// kitkat fix for touchcancel events http://updates.html5rocks.com/2014/05/A-More-Compatible-Smoother-Touch // kitkat fix for touchcancel events http://updates.html5rocks.com/2014/05/A-More-Compatible-Smoother-Touch
/* /*
if (ionic.Platform.isAndroid() && ionic.Platform.version() === 4.4 && scrollAncestor.scrollTop === 0) { if (ionic.Platform.isAndroid() && ionic.Platform.version() === 4.4 && scrollHost.scrollTop === 0) {
isDragging = true; isDragging = true;
e.preventDefault(); e.preventDefault();
} }
@ -260,7 +259,7 @@ export class Refresher {
// if we've dragged up and back down in to native scroll territory // if we've dragged up and back down in to native scroll territory
if (this.deltaY - this.dragOffset <= 0 || this.scrollAncestor.scrollTop !== 0) { if (this.deltaY - this.dragOffset <= 0 || this.scrollHost.scrollTop !== 0) {
if (this.isOverscrolling) { if (this.isOverscrolling) {
this.isOverscrolling = false; this.isOverscrolling = false;
@ -268,7 +267,7 @@ export class Refresher {
} }
if (this.isDragging) { if (this.isDragging) {
this.nativescroll(this.scrollAncestor, parseInt(this.deltaY - this.dragOffset, 10) * -1); this.nativescroll(this.scrollHost, parseInt(this.deltaY - this.dragOffset, 10) * -1);
} }
// if we're not at overscroll 0 yet, 0 out // if we're not at overscroll 0 yet, 0 out
@ -277,7 +276,7 @@ export class Refresher {
} }
return; return;
} else if (this.deltaY > 0 && this.scrollAncestor.scrollTop === 0 && !this.isOverscrolling) { } else if (this.deltaY > 0 && this.scrollHost.scrollTop === 0 && !this.isOverscrolling) {
// starting overscroll, but drag started below scrollTop 0, so we need to offset the position // starting overscroll, but drag started below scrollTop 0, so we need to offset the position
this.dragOffset = this.deltaY; this.dragOffset = this.deltaY;
} }

View File

@ -1,4 +1,4 @@
import {View, Renderer, ElementRef, EventEmitter, Ancestor, forwardRef} from 'angular2/angular2'; import {View, Renderer, ElementRef, EventEmitter, Host, forwardRef} from 'angular2/angular2';
import {Control, NgControl,NgFormControl} from 'angular2/forms'; import {Control, NgControl,NgFormControl} from 'angular2/forms';
import {ControlGroup, ControlDirective} from 'angular2/forms' import {ControlGroup, ControlDirective} from 'angular2/forms'
@ -168,7 +168,7 @@ export class SegmentControlValueAccessor {
}) })
export class SegmentButton { export class SegmentButton {
constructor( constructor(
@Ancestor() segment: Segment, @Host() segment: Segment,
elementRef: ElementRef elementRef: ElementRef
) { ) {
this.ele = elementRef.ele this.ele = elementRef.ele

View File

@ -1,4 +1,4 @@
import {Component, View, ElementRef, onInit, Ancestor, NgFor} from 'angular2/angular2'; import {Component, View, ElementRef, onInit, Host, NgFor} from 'angular2/angular2';
import {DragGesture} from 'ionic/gestures/drag-gesture'; import {DragGesture} from 'ionic/gestures/drag-gesture';
import {IonicComponent, IonicDirective} from '../../config/annotations'; import {IonicComponent, IonicDirective} from '../../config/annotations';
@ -452,7 +452,7 @@ export class Slides {
}) })
export class Slide { export class Slide {
constructor( constructor(
@Ancestor() slides: Slides, @Host() slides: Slides,
elementRef: ElementRef elementRef: ElementRef
) { ) {
this.ele = elementRef.nativeElement; this.ele = elementRef.nativeElement;
@ -502,7 +502,7 @@ export class Slide {
}) })
export class SlidePager { export class SlidePager {
constructor( constructor(
@Ancestor() slides: Slides, @Host() slides: Slides,
elementRef: ElementRef elementRef: ElementRef
) { ) {
this.ele = elementRef.nativeElement; this.ele = elementRef.nativeElement;

View File

@ -2,7 +2,7 @@ import {
View, View,
Directive, Directive,
ElementRef, ElementRef,
Ancestor, Host,
Optional, Optional,
NgControl, NgControl,
Renderer, Renderer,
@ -29,7 +29,7 @@ import {pointerCoord} from '../../util/dom';
}) })
class MediaSwitch { class MediaSwitch {
constructor( constructor(
@Ancestor() @Inject(forwardRef(() => Switch)) swtch: Switch, @Host() @Inject(forwardRef(() => Switch)) swtch: Switch,
elementRef: ElementRef, elementRef: ElementRef,
config: IonicConfig config: IonicConfig
) { ) {

View File

@ -1,4 +1,4 @@
import {Directive, Component, View, onInit, Ancestor, ElementRef, forwardRef, Injector} from 'angular2/angular2'; import {Directive, Component, View, Host, ElementRef, forwardRef, Injector} from 'angular2/angular2';
import {ViewController} from '../view/view-controller'; import {ViewController} from '../view/view-controller';
import {ViewItem} from '../view/view-item'; import {ViewItem} from '../view/view-item';
@ -27,19 +27,19 @@ import {Tabs} from './tabs';
export class Tab extends ViewController { export class Tab extends ViewController {
constructor( constructor(
@Ancestor() tabs: Tabs, @Host() tabs: Tabs,
elementRef: ElementRef, elementRef: ElementRef,
injector: Injector injector: Injector
) { ) {
// A Tab is both a container of many views, and is a view itself. // A Tab is both a container of many views, and is a view itself.
// A Tab is one ViewItem within it's Ancestor Tabs (which extends ViewController) // A Tab is one ViewItem within it's Host Tabs (which extends ViewController)
// A Tab is a ViewController for its child ViewItems // A Tab is a ViewController for its child ViewItems
super(tabs, injector, elementRef); super(tabs, injector, elementRef);
this.tabs = tabs; this.tabs = tabs;
this.childNavbar(true); this.childNavbar(true);
let item = this.item = new ViewItem(tabs.Ancestor); let item = this.item = new ViewItem(tabs.Host);
item.setInstance(this); item.setInstance(this);
item.viewElementRef(elementRef); item.viewElementRef(elementRef);
tabs.addTab(this); tabs.addTab(this);
@ -105,7 +105,7 @@ export class Tab extends ViewController {
selector: 'template[pane-anchor]' selector: 'template[pane-anchor]'
}) })
class TabPaneAnchor { class TabPaneAnchor {
constructor(@Ancestor() tab: Tab, elementRef: ElementRef) { constructor(@Host() tab: Tab, elementRef: ElementRef) {
tab.anchorElementRef(elementRef); tab.anchorElementRef(elementRef);
} }
} }

View File

@ -1,4 +1,4 @@
import {Component, Directive, View, Injector, NgFor, ElementRef, Optional, Ancestor, forwardRef} from 'angular2/angular2'; import {Component, Directive, View, Injector, NgFor, ElementRef, Optional, Host, forwardRef} from 'angular2/angular2';
import {ViewController} from '../view/view-controller'; import {ViewController} from '../view/view-controller';
import {ViewItem} from '../view/view-item'; import {ViewItem} from '../view/view-item';
@ -30,12 +30,12 @@ import {IonicComponent, IonicView} from '../../config/annotations';
}) })
export class Tabs extends ViewController { export class Tabs extends ViewController {
constructor( constructor(
@Optional() AncestorViewCtrl: ViewController, @Optional() hostViewCtrl: ViewController,
@Optional() viewItem: ViewItem, @Optional() viewItem: ViewItem,
injector: Injector, injector: Injector,
elementRef: ElementRef elementRef: ElementRef
) { ) {
super(AncestorViewCtrl, injector, elementRef); super(hostViewCtrl, injector, elementRef);
// Tabs may also be an actual ViewItem which was navigated to // Tabs may also be an actual ViewItem which was navigated to
// if Tabs is static and not navigated to within a ViewController // if Tabs is static and not navigated to within a ViewController
@ -126,7 +126,7 @@ export class Tabs extends ViewController {
} }
}) })
class TabButton { class TabButton {
constructor(@Ancestor() tabs: Tabs) { constructor(@Host() tabs: Tabs) {
this.tabs = tabs; this.tabs = tabs;
} }

View File

@ -1,4 +1,4 @@
import {Directive, View, Ancestor, onInit, ElementRef, forwardRef} from 'angular2/angular2'; import {Directive, View, Host, ElementRef, forwardRef} from 'angular2/angular2';
import {Ion} from '../ion'; import {Ion} from '../ion';
import {IonicConfig} from '../../config/config'; import {IonicConfig} from '../../config/config';
@ -120,7 +120,7 @@ export class Toolbar extends ToolbarBase {
selector: '.toolbar-title' selector: '.toolbar-title'
}) })
class ToolbarTitle { class ToolbarTitle {
constructor(@Ancestor() toolbar: Toolbar, elementRef: ElementRef) { constructor(@Host() toolbar: Toolbar, elementRef: ElementRef) {
toolbar.titleElement(elementRef); toolbar.titleElement(elementRef);
} }
} }
@ -130,7 +130,7 @@ class ToolbarTitle {
selector: '.toolbar-item' selector: '.toolbar-item'
}) })
class ToolbarItem { class ToolbarItem {
constructor(@Ancestor() toolbar: Toolbar, elementRef: ElementRef) { constructor(@Host() toolbar: Toolbar, elementRef: ElementRef) {
toolbar.itemElements(elementRef); toolbar.itemElements(elementRef);
} }
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long