Skip to content

Commit

Permalink
feat(package): updated angular2 to 0-beta.16
Browse files Browse the repository at this point in the history
  • Loading branch information
valorkin committed Apr 26, 2016
1 parent 19dd0a5 commit 75b3568
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 30 deletions.
19 changes: 9 additions & 10 deletions components/datepicker/datepicker-popup.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
Component, Directive, EventEmitter, ComponentRef, ViewEncapsulation,
ElementRef, DynamicComponentLoader, Self, Renderer, bind, Injector
ElementRef, DynamicComponentLoader, Self, Renderer, ReflectiveInjector, provide, ViewContainerRef
} from 'angular2/core';
import {
CORE_DIRECTIVES, FORM_DIRECTIVES, NgClass, NgModel, NgStyle
Expand Down Expand Up @@ -121,7 +121,7 @@ class PopupContainer {
})
export class DatePickerPopup {
public cd:NgModel;
public element:ElementRef;
public viewContainerRef:ViewContainerRef;
public renderer:Renderer;
public loader:DynamicComponentLoader;

Expand All @@ -130,10 +130,10 @@ export class DatePickerPopup {
private placement:string = 'bottom';
private popup:Promise<ComponentRef>;

public constructor(@Self() cd:NgModel, element:ElementRef,
public constructor(@Self() cd:NgModel, viewContainerRef:ViewContainerRef,
renderer:Renderer, loader:DynamicComponentLoader) {
this.cd = cd;
this.element = element;
this.viewContainerRef = viewContainerRef;
this.renderer = renderer;
this.loader = loader;
this.activeDate = cd.model;
Expand Down Expand Up @@ -168,7 +168,7 @@ export class DatePickerPopup {
public hide(cb:Function):void {
if (this.popup) {
this.popup.then((componentRef:ComponentRef) => {
componentRef.dispose();
componentRef.destroy();
cb();
return componentRef;
});
Expand All @@ -182,15 +182,14 @@ export class DatePickerPopup {
placement: this.placement
});

let binding = Injector.resolve([
bind(PopupOptions)
.toValue(options)
let binding = ReflectiveInjector.resolve([
provide(PopupOptions, {useValue: options})
]);

this.popup = this.loader
.loadNextToLocation(PopupContainer, this.element, binding)
.loadNextToLocation(PopupContainer, this.viewContainerRef, binding)
.then((componentRef:ComponentRef) => {
componentRef.instance.position(this.element);
componentRef.instance.position(this.viewContainerRef);
componentRef.instance.popupComp = this;
/*componentRef.instance.update1.observer({
next: (newVal) => {
Expand Down
18 changes: 9 additions & 9 deletions components/tooltip/tooltip.directive.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
Directive, Input, HostListener, ElementRef, DynamicComponentLoader,
ComponentRef, Provider, Injector
Directive, Input, HostListener, DynamicComponentLoader,
ComponentRef, Provider, ReflectiveInjector, ViewContainerRef
} from 'angular2/core';
import {TooltipOptions} from './tooltip-options.class';
import {TooltipContainer} from './tooltip-container.component';
Expand All @@ -16,14 +16,14 @@ export class Tooltip {
@Input('tooltipAppendToBody') public appendToBody:boolean;
/* tslint:enable */

public element:ElementRef;
public viewContainerRef:ViewContainerRef;
public loader:DynamicComponentLoader;

private visible:boolean = false;
private tooltip:Promise<ComponentRef>;

public constructor(element:ElementRef, loader:DynamicComponentLoader) {
this.element = element;
public constructor(viewContainerRef:ViewContainerRef, loader:DynamicComponentLoader) {
this.viewContainerRef = viewContainerRef;
this.loader = loader;
}

Expand All @@ -40,15 +40,15 @@ export class Tooltip {
content: this.content,
placement: this.placement,
animation: this.animation,
hostEl: this.element
hostEl: this.viewContainerRef.element
});

let binding = Injector.resolve([
let binding = ReflectiveInjector.resolve([
new Provider(TooltipOptions, {useValue: options})
]);

this.tooltip = this.loader
.loadNextToLocation(TooltipContainer, this.element, binding)
.loadNextToLocation(TooltipContainer, this.viewContainerRef, binding)
.then((componentRef:ComponentRef) => {
return componentRef;
});
Expand All @@ -63,7 +63,7 @@ export class Tooltip {
}
this.visible = false;
this.tooltip.then((componentRef:ComponentRef) => {
componentRef.dispose();
componentRef.destroy();
return componentRef;
});
}
Expand Down
16 changes: 9 additions & 7 deletions components/typeahead/typeahead.directive.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
Directive, Input, Output, HostListener, EventEmitter, OnInit, ElementRef,
Renderer, DynamicComponentLoader, ComponentRef, Injector, provide
Renderer, DynamicComponentLoader, ComponentRef, ReflectiveInjector, provide, ViewContainerRef
} from 'angular2/core';
import {NgModel} from 'angular2/common';
import {TypeaheadUtils} from './typeahead-utils';
Expand Down Expand Up @@ -49,6 +49,7 @@ export class Typeahead implements OnInit {
private popup:Promise<ComponentRef>;

private cd:NgModel;
private viewContainerRef:ViewContainerRef;
private element:ElementRef;
private renderer:Renderer;
private loader:DynamicComponentLoader;
Expand Down Expand Up @@ -150,10 +151,11 @@ export class Typeahead implements OnInit {
}
}

public constructor(cd:NgModel, element:ElementRef,
public constructor(cd:NgModel, viewContainerRef:ViewContainerRef, element:ElementRef,
renderer:Renderer, loader:DynamicComponentLoader) {
this.cd = cd;
this.element = element;
this.cd = cd;
this.viewContainerRef = viewContainerRef;
this.renderer = renderer;
this.loader = loader;
}
Expand Down Expand Up @@ -207,14 +209,14 @@ export class Typeahead implements OnInit {
animation: false
});

let binding = Injector.resolve([
let binding = ReflectiveInjector.resolve([
provide(TypeaheadOptions, {useValue: options})
]);

this.popup = this.loader
.loadNextToLocation(TypeaheadContainer, this.element, binding)
.loadNextToLocation(TypeaheadContainer, this.viewContainerRef, binding)
.then((componentRef:ComponentRef) => {
componentRef.instance.position(this.element);
componentRef.instance.position(this.viewContainerRef.element);
this.container = componentRef.instance;
this.container.parent = this;
// This improves the speedas it won't have to be done for each list item
Expand All @@ -235,7 +237,7 @@ export class Typeahead implements OnInit {
public hide():void {
if (this.container) {
this.popup.then((componentRef:ComponentRef) => {
componentRef.dispose();
componentRef.destroy();
this.container = void 0;
return componentRef;
});
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,20 @@
},
"homepage": "https://github.com/valor-software/ng2-bootstrap#readme",
"dependencies": {
"angular2": "2.0.0-beta.15",
"moment": "2.13.0"
},
"peerDependencies": {
"angular2": "2.0.0-beta.15"
"angular2": "2.0.0-beta.16"
},
"devDependencies": {
"angular2": "2.0.0-beta.16",
"async": "1.5.2",
"balanced-match": "0.4.0",
"bootstrap": "3.3.6",
"compression-webpack-plugin": "0.3.1",
"conventional-changelog-cli": "1.1.1",
"conventional-github-releaser": "1.1.2",
"copy-webpack-plugin": "2.1.1",
"copy-webpack-plugin": "2.1.3",
"cpy-cli": "1.0.0",
"del-cli": "0.2.0",
"es6-promise": "3.1.2",
Expand Down Expand Up @@ -100,7 +100,7 @@
"source-map-loader": "0.1.5",
"systemjs-builder": "0.15.15",
"ts-loader": "0.8.2",
"tslint-config-valorsoft": "0.0.7",
"tslint-config-valorsoft": "1.0.1",
"typescript": "1.8.10",
"typings": "0.8.1",
"webpack": "1.13.0",
Expand Down

0 comments on commit 75b3568

Please sign in to comment.