Skip to content

Commit

Permalink
fix(universal): now plays well with ng2 universal
Browse files Browse the repository at this point in the history
fixes #61
  • Loading branch information
valorkin committed Apr 28, 2016
1 parent 67ee5b5 commit 9d595d3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
5 changes: 5 additions & 0 deletions components/dropdown/dropdown-toggle.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ import {
} from 'angular2/core';
import {DropdownDirective} from './dropdown.directive';

import {global} from 'angular2/src/facade/lang';
/* tslint:disable */
const MouseEvent = (global as any).MouseEvent as MouseEvent;
/* tslint:enable */

@Directive({selector: '[dropdownToggle]'})
export class DropdownToggleDirective implements OnInit {
@HostBinding('class.disabled')
Expand Down
5 changes: 3 additions & 2 deletions components/ng2-bootstrap-config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import {global} from 'angular2/src/facade/lang';

export enum Ng2BootstrapTheme {BS3 = 1, BS4 = 2}

export class Ng2BootstrapConfig {
private static _theme:Ng2BootstrapTheme;

public static get theme():Ng2BootstrapTheme {
// hack as for now
let w:any = window;
if (w && w.__theme === 'bs4') {
if (global && (global as any).__theme === 'bs4') {
return Ng2BootstrapTheme.BS4;
}
return (this._theme || Ng2BootstrapTheme.BS3);
Expand Down
5 changes: 5 additions & 0 deletions components/rating/rating.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ import {
} from 'angular2/core';
import {NgFor, ControlValueAccessor, NgModel} from 'angular2/common';

import {global} from 'angular2/src/facade/lang';
/* tslint:disable */
const KeyboardEvent = (global as any).KeyboardEvent as KeyboardEvent;
/* tslint:enable */

@Component({
/* tslint:disable */
selector: 'rating[ngModel]',
Expand Down
5 changes: 5 additions & 0 deletions components/typeahead/typeahead.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ import {TypeaheadUtils} from './typeahead-utils';
import {TypeaheadContainerComponent} from './typeahead-container.component';
import {TypeaheadOptions} from './typeahead-options.class';

import {global} from 'angular2/src/facade/lang';
/* tslint:disable */
const KeyboardEvent = (global as any).KeyboardEvent as KeyboardEvent;
/* tslint:enable */

// https://github.com/angular/angular/blob/master/modules/angular2/src/core/forms/directives/shared.ts
function setProperty(renderer:Renderer, elementRef:ElementRef, propName:string, propValue:any):void {
renderer.setElementProperty(elementRef.nativeElement, propName, propValue);
Expand Down

0 comments on commit 9d595d3

Please sign in to comment.