Skip to content

Commit

Permalink
fix: restore AoT compatibility with 2.1.1
Browse files Browse the repository at this point in the history
Fixes #953

Closes #973
  • Loading branch information
pkozlowski-opensource committed Oct 28, 2016
1 parent 2fb72d8 commit 991c880
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 21 deletions.
6 changes: 4 additions & 2 deletions src/accordion/accordion.module.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import {NgModule, ModuleWithProviders} from '@angular/core';
import {CommonModule} from '@angular/common';

import {NGB_ACCORDION_DIRECTIVES} from './accordion';
import {NgbAccordion, NgbPanel, NgbPanelTitle, NgbPanelContent, NgbPanelChangeEvent} from './accordion';
import {NgbAccordionConfig} from './accordion-config';

export {NgbPanelChangeEvent} from './accordion';
export {NgbAccordion, NgbPanel, NgbPanelTitle, NgbPanelContent, NgbPanelChangeEvent} from './accordion';
export {NgbAccordionConfig} from './accordion-config';

const NGB_ACCORDION_DIRECTIVES = [NgbAccordion, NgbPanel, NgbPanelTitle, NgbPanelContent];

@NgModule({declarations: NGB_ACCORDION_DIRECTIVES, exports: NGB_ACCORDION_DIRECTIVES, imports: [CommonModule]})
export class NgbAccordionModule {
static forRoot(): ModuleWithProviders { return {ngModule: NgbAccordionModule, providers: [NgbAccordionConfig]}; }
Expand Down
2 changes: 0 additions & 2 deletions src/accordion/accordion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,5 +209,3 @@ export class NgbAccordion implements AfterContentChecked {
});
}
}

export const NGB_ACCORDION_DIRECTIVES = [NgbAccordion, NgbPanel, NgbPanelTitle, NgbPanelContent];
6 changes: 5 additions & 1 deletion src/buttons/radio.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import {NgModule, ModuleWithProviders} from '@angular/core';
import {NGB_RADIO_DIRECTIVES} from './radio';
import {NgbRadio, NgbActiveLabel, NgbRadioGroup} from './radio';

export {NgbRadio, NgbActiveLabel, NgbRadioGroup} from './radio';

const NGB_RADIO_DIRECTIVES = [NgbRadio, NgbActiveLabel, NgbRadioGroup];

@NgModule({declarations: NGB_RADIO_DIRECTIVES, exports: NGB_RADIO_DIRECTIVES})
export class NgbButtonsModule {
Expand Down
2 changes: 0 additions & 2 deletions src/buttons/radio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,3 @@ export class NgbRadio implements OnDestroy {
this._label.disabled = this._disabled;
}
}

export const NGB_RADIO_DIRECTIVES = [NgbRadio, NgbActiveLabel, NgbRadioGroup];
6 changes: 4 additions & 2 deletions src/collapse/collapse.module.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import {NgModule, ModuleWithProviders} from '@angular/core';
import {NGB_COLLAPSE_DIRECTIVES} from './collapse';
import {NgbCollapse} from './collapse';

@NgModule({declarations: NGB_COLLAPSE_DIRECTIVES, exports: NGB_COLLAPSE_DIRECTIVES})
export {NgbCollapse} from './collapse';

@NgModule({declarations: [NgbCollapse], exports: [NgbCollapse]})
export class NgbCollapseModule {
static forRoot(): ModuleWithProviders { return {ngModule: NgbCollapseModule, providers: []}; }
}
2 changes: 0 additions & 2 deletions src/collapse/collapse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,3 @@ export class NgbCollapse {
*/
@Input('ngbCollapse') collapsed = false;
}

export const NGB_COLLAPSE_DIRECTIVES = [NgbCollapse];
1 change: 1 addition & 0 deletions src/datepicker/datepicker.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {NgbDatepickerNavigationSelect} from './datepicker-navigation-select';
import {NgbDatepickerConfig} from './datepicker-config';

export {NgbDatepicker} from './datepicker';
export {NgbInputDatepicker} from './datepicker-input';
export {NgbDatepickerMonthView} from './datepicker-month-view';
export {NgbDatepickerDayView} from './datepicker-day-view';
export {NgbDatepickerNavigation} from './datepicker-navigation';
Expand Down
4 changes: 2 additions & 2 deletions src/datepicker/datepicker.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Component, Input, OnChanges, TemplateRef, forwardRef, OnInit} from '@angular/core';
import {Component, Input, OnChanges, TemplateRef, forwardRef, OnInit, SimpleChanges} from '@angular/core';
import {NG_VALUE_ACCESSOR, ControlValueAccessor} from '@angular/forms';
import {NgbCalendar} from './ngb-calendar';
import {NgbDate} from './ngb-date';
Expand Down Expand Up @@ -149,7 +149,7 @@ export class NgbDatepicker implements OnChanges,
this.navigateTo(this.startDate);
}

ngOnChanges() {
ngOnChanges(changes: SimpleChanges) {
this._setDates();
this.navigateTo(this.startDate);
}
Expand Down
5 changes: 4 additions & 1 deletion src/dropdown/dropdown.module.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import {NgModule, ModuleWithProviders} from '@angular/core';
import {NGB_DROPDOWN_DIRECTIVES} from './dropdown';
import {NgbDropdown, NgbDropdownToggle} from './dropdown';
import {NgbDropdownConfig} from './dropdown-config';

export {NgbDropdown, NgbDropdownToggle} from './dropdown';
export {NgbDropdownConfig} from './dropdown-config';

const NGB_DROPDOWN_DIRECTIVES = [NgbDropdownToggle, NgbDropdown];

@NgModule({declarations: NGB_DROPDOWN_DIRECTIVES, exports: NGB_DROPDOWN_DIRECTIVES})
export class NgbDropdownModule {
static forRoot(): ModuleWithProviders { return {ngModule: NgbDropdownModule, providers: [NgbDropdownConfig]}; }
Expand Down
4 changes: 1 addition & 3 deletions src/dropdown/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class NgbDropdown {
/**
* Defines whether or not the dropdown-menu is open initially.
*/
@Input('open') private _open = false;
@Input('open') _open = false;

/**
* An event fired when the dropdown is opened or closed.
Expand Down Expand Up @@ -120,5 +120,3 @@ export class NgbDropdownToggle {

toggleOpen() { this.dropdown.toggle(); }
}

export const NGB_DROPDOWN_DIRECTIVES = [NgbDropdownToggle, NgbDropdown];
6 changes: 4 additions & 2 deletions src/tabset/tabset.module.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import {NgModule, ModuleWithProviders} from '@angular/core';
import {CommonModule} from '@angular/common';

import {NGB_TABSET_DIRECTIVES} from './tabset';
import {NgbTabset, NgbTab, NgbTabContent, NgbTabTitle, NgbTabChangeEvent} from './tabset';
import {NgbTabsetConfig} from './tabset-config';

export {NgbTabChangeEvent} from './tabset';
export {NgbTabset, NgbTab, NgbTabContent, NgbTabTitle, NgbTabChangeEvent} from './tabset';
export {NgbTabsetConfig} from './tabset-config';

const NGB_TABSET_DIRECTIVES = [NgbTabset, NgbTab, NgbTabContent, NgbTabTitle];

@NgModule({declarations: NGB_TABSET_DIRECTIVES, exports: NGB_TABSET_DIRECTIVES, imports: [CommonModule]})
export class NgbTabsetModule {
static forRoot(): ModuleWithProviders { return {ngModule: NgbTabsetModule, providers: [NgbTabsetConfig]}; }
Expand Down
2 changes: 0 additions & 2 deletions src/tabset/tabset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,3 @@ export class NgbTabset implements AfterContentChecked {
return tabsWithId.length ? tabsWithId[0] : null;
}
}

export const NGB_TABSET_DIRECTIVES = [NgbTabset, NgbTab, NgbTabContent, NgbTabTitle];

0 comments on commit 991c880

Please sign in to comment.