Skip to content

Commit

Permalink
update lib to rc6
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksandr Telnov committed Sep 1, 2016
1 parent 873fec1 commit 90cb0dd
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 34 deletions.
4 changes: 2 additions & 2 deletions components/dropdown/dropdown-toggle.directive.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {
Directive, ElementRef, Host, HostBinding, HostListener, Input, OnInit
} from '@angular/core';
import { global } from '@angular/core/src/facade/lang';
import { Type } from '@angular/core';

import { DropdownDirective } from './dropdown.directive';

/* tslint:disable */
const MouseEvent = (global as any).MouseEvent as MouseEvent;
const MouseEvent = (Type as any).MouseEvent as MouseEvent;
/* tslint:enable */

@Directive({
Expand Down
4 changes: 2 additions & 2 deletions components/modal/modal.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
Output,
Renderer
} from '@angular/core';
import { global } from '@angular/core/src/facade/lang';
import { Type } from '@angular/core';

import { ComponentsHelper } from '../utils/components-helper.service';
import { Utils } from '../utils/utils.class';
Expand Down Expand Up @@ -303,7 +303,7 @@ export class ModalDirective implements AfterViewInit, OnDestroy {

private checkScrollbar():void {
// this._isBodyOverflowing = document.body.clientWidth < window.innerWidth
this.isBodyOverflowing = this.document.body.clientWidth < (global as any).innerWidth;
this.isBodyOverflowing = this.document.body.clientWidth < (Type as any).innerWidth;
this.scrollbarWidth = this.getScrollbarWidth();
}

Expand Down
5 changes: 2 additions & 3 deletions components/ng2-bootstrap-config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { global } from '@angular/core/src/facade/lang';

import { Type } from '@angular/core';
export enum Ng2BootstrapTheme {BS3 = 1, BS4 = 2}

export class Ng2BootstrapConfig {
private static _theme:Ng2BootstrapTheme;

public static get theme():Ng2BootstrapTheme {
// hack as for now
if (global && (global as any).__theme === 'bs4') {
if (Type && (Type as any).__theme === 'bs4') {
return Ng2BootstrapTheme.BS4;
}
return (this._theme || Ng2BootstrapTheme.BS3);
Expand Down
4 changes: 2 additions & 2 deletions components/rating/rating.component.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {
Component, EventEmitter, HostListener, Input, OnInit, Output, Self
} from '@angular/core';
import { global } from '@angular/core/src/facade/lang';
import { Type } from '@angular/core';
import { ControlValueAccessor, NgModel } from '@angular/forms';

/* tslint:disable */
const KeyboardEvent = (global as any).KeyboardEvent as KeyboardEvent;
const KeyboardEvent = (Type as any).KeyboardEvent as KeyboardEvent;
/* tslint:enable */

@Component({
Expand Down
4 changes: 2 additions & 2 deletions components/typeahead/typeahead.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ import 'rxjs/add/operator/map';
import 'rxjs/add/operator/mergeMap';
import 'rxjs/add/operator/toArray';

import { global } from '@angular/core/src/facade/lang';
import { Type } from '@angular/core';
import { ComponentsHelper } from '../utils/components-helper.service';
/* tslint:disable */
const KeyboardEvent = (global as any).KeyboardEvent as KeyboardEvent;
const KeyboardEvent = (Type as any).KeyboardEvent as KeyboardEvent;
/* tslint:enable */

@Directive({
Expand Down
9 changes: 4 additions & 5 deletions components/utils/components-helper.service.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import {
ApplicationRef, ComponentFactoryResolver, ComponentRef, Injectable, Injector, ReflectiveInjector, ViewContainerRef,
ResolvedReflectiveProvider
ResolvedReflectiveProvider, Type
} from '@angular/core';
import { ConcreteType, isPresent } from '@angular/core/src/facade/lang';
import { DOCUMENT } from '@angular/platform-browser';

/**
Expand Down Expand Up @@ -62,12 +61,12 @@ export class ComponentsHelper {
* @param providers - optional array of providers
* @returns {ComponentRef<T>} - returns ComponentRef<T>
*/
public appendNextToLocation<T>(ComponentClass:ConcreteType<T>,
public appendNextToLocation<T>(ComponentClass:Type<T>,
location:ViewContainerRef,
providers?:ResolvedReflectiveProvider[]):ComponentRef<T> {
let componentFactory = this.componentFactoryResolver.resolveComponentFactory(ComponentClass);
let parentInjector = location.parentInjector;
let childInjector = isPresent(providers) && providers.length > 0 ?
let childInjector = providers !== undefined && providers.length > 0 ?
ReflectiveInjector.fromResolvedProviders(providers, parentInjector) : parentInjector;
return location.createComponent(componentFactory, location.length, childInjector);
}
Expand All @@ -82,7 +81,7 @@ export class ComponentsHelper {
* @param contextInjector - injector to resolve root view container (any injector except root injector will fit)
* @returns {ComponentRef<T>} - returns ComponentRef<T>
*/
public appendNextToRoot<T>(ComponentClass:ConcreteType<T>,
public appendNextToRoot<T>(ComponentClass:Type<T>,
ComponentOptionsClass:any,
options:any,
contextInjector:Injector):ComponentRef<T> {
Expand Down
4 changes: 2 additions & 2 deletions components/utils/utils.class.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { global } from '@angular/core/src/facade/lang';
import { Type } from '@angular/core';

export class Utils {
public static reflow(element:any):void {
Expand All @@ -13,7 +13,7 @@ export class Utils {
let view = elem.ownerDocument.defaultView;

if (!view || !view.opener) {
view = global;
view = Type;
}

return view.getComputedStyle(elem);
Expand Down
4 changes: 1 addition & 3 deletions demo/components/main-menu/main-menu.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ import { NavigationEnd, Router } from '@angular/router';

import { Ng2BootstrapConfig, Ng2BootstrapTheme } from '../../../components/ng2-bootstrap-config';
import { routes } from './../../router.config';
import { SearchFilterPipe } from './search-filter.pipe';

// webpack html imports
let template = require('./main-menu.template.html');

@Component({
selector: 'main-menu',
template,
pipes: [SearchFilterPipe]
template
})

export class MainMenuComponent {
Expand Down
2 changes: 2 additions & 0 deletions demo/ng2-bootstrap-demo.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
import { DemoSectionComponent } from './components/demo-section';
import { GettingStartedSectionComponent } from './components/getting-started/getting-started';
import { MainMenuComponent } from './components/main-menu/main-menu.component';
import { SearchFilterPipe } from './components/main-menu/search-filter.pipe';
import { TopMenuComponent } from './components/top-menu/top-menu.component';

import { DemoComponent } from './app.component';
Expand Down Expand Up @@ -53,6 +54,7 @@ import { TypeaheadSectionComponent } from './components/typeahead-section';
GettingStartedSectionComponent,
MainMenuComponent,
TopMenuComponent,
SearchFilterPipe,

AccordionDemoComponent,
AlertDemoComponent,
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,19 @@
"moment": "2.14.1"
},
"peerDependencies": {
"@angular/common": "2.0.0-rc.5",
"@angular/compiler": "2.0.0-rc.5",
"@angular/core": "2.0.0-rc.5",
"@angular/forms": "0.3.0"
"@angular/common": "2.0.0-rc.6",
"@angular/compiler": "2.0.0-rc.6",
"@angular/core": "2.0.0-rc.6",
"@angular/forms": "2.0.0-rc.6"
},
"devDependencies": {
"@angular/common": "2.0.0-rc.5",
"@angular/compiler": "2.0.0-rc.5",
"@angular/core": "2.0.0-rc.5",
"@angular/forms": "0.3.0",
"@angular/platform-browser": "2.0.0-rc.5",
"@angular/platform-browser-dynamic": "2.0.0-rc.5",
"@angular/router": "3.0.0-rc.1",
"@angular/common": "2.0.0-rc.6",
"@angular/compiler": "2.0.0-rc.6",
"@angular/core": "2.0.0-rc.6",
"@angular/forms": "2.0.0-rc.6",
"@angular/platform-browser": "2.0.0-rc.6",
"@angular/platform-browser-dynamic": "2.0.0-rc.6",
"@angular/router": "3.0.0-rc.2",
"async": "2.0.1",
"bootstrap": "3.3.7",
"codecov": "1.0.1",
Expand All @@ -91,11 +91,11 @@
"reflect-metadata": "0.1.8",
"require-dir": "0.3.0",
"rxjs": "5.0.0-beta.11",
"systemjs-builder": "0.15.29",
"systemjs-builder": "0.15.30",
"tslint-config-valorsoft": "1.1.1",
"typedoc": "0.4.5",
"typescript": "1.8.10",
"typings": "1.3.2",
"typings": "1.3.3",
"zone.js": "0.6.17"
}
}

0 comments on commit 90cb0dd

Please sign in to comment.