From 75b3568309fb5a274e624ac7e058a3080ceffb7a Mon Sep 17 00:00:00 2001 From: Dmitriy Shekhovtsov Date: Tue, 26 Apr 2016 15:00:47 +0300 Subject: [PATCH] feat(package): updated angular2 to 0-beta.16 --- components/datepicker/datepicker-popup.ts | 19 +++++++++---------- components/tooltip/tooltip.directive.ts | 18 +++++++++--------- components/typeahead/typeahead.directive.ts | 16 +++++++++------- package.json | 8 ++++---- 4 files changed, 31 insertions(+), 30 deletions(-) diff --git a/components/datepicker/datepicker-popup.ts b/components/datepicker/datepicker-popup.ts index 6c443568b9..fcd21f50d6 100644 --- a/components/datepicker/datepicker-popup.ts +++ b/components/datepicker/datepicker-popup.ts @@ -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 @@ -121,7 +121,7 @@ class PopupContainer { }) export class DatePickerPopup { public cd:NgModel; - public element:ElementRef; + public viewContainerRef:ViewContainerRef; public renderer:Renderer; public loader:DynamicComponentLoader; @@ -130,10 +130,10 @@ export class DatePickerPopup { private placement:string = 'bottom'; private popup:Promise; - 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; @@ -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; }); @@ -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) => { diff --git a/components/tooltip/tooltip.directive.ts b/components/tooltip/tooltip.directive.ts index d16fb9c33e..9988ec8196 100644 --- a/components/tooltip/tooltip.directive.ts +++ b/components/tooltip/tooltip.directive.ts @@ -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'; @@ -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; - public constructor(element:ElementRef, loader:DynamicComponentLoader) { - this.element = element; + public constructor(viewContainerRef:ViewContainerRef, loader:DynamicComponentLoader) { + this.viewContainerRef = viewContainerRef; this.loader = loader; } @@ -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; }); @@ -63,7 +63,7 @@ export class Tooltip { } this.visible = false; this.tooltip.then((componentRef:ComponentRef) => { - componentRef.dispose(); + componentRef.destroy(); return componentRef; }); } diff --git a/components/typeahead/typeahead.directive.ts b/components/typeahead/typeahead.directive.ts index 02308da6aa..5e84d29586 100644 --- a/components/typeahead/typeahead.directive.ts +++ b/components/typeahead/typeahead.directive.ts @@ -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'; @@ -49,6 +49,7 @@ export class Typeahead implements OnInit { private popup:Promise; private cd:NgModel; + private viewContainerRef:ViewContainerRef; private element:ElementRef; private renderer:Renderer; private loader:DynamicComponentLoader; @@ -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; } @@ -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 @@ -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; }); diff --git a/package.json b/package.json index c08b52619d..ba5a58a88a 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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",