Skip to content

Commit

Permalink
fix: restore full AoT compatibility
Browse files Browse the repository at this point in the history
Fixes #796

Closes #854
  • Loading branch information
pkozlowski-opensource committed Oct 8, 2016
1 parent e888d67 commit 2101a89
Show file tree
Hide file tree
Showing 21 changed files with 27 additions and 101 deletions.
10 changes: 3 additions & 7 deletions src/alert/alert.module.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import {NgModule, ModuleWithProviders} from '@angular/core';
import {CommonModule} from '@angular/common';

import {NGB_ALERT_DIRECTIVES, NgbAlert} from './alert';
import {NgbAlert} from './alert';
import {NgbAlertConfig} from './alert-config';

export {NgbAlert} from './alert';
export {NgbAlertConfig} from './alert-config';

@NgModule({
declarations: NGB_ALERT_DIRECTIVES,
exports: NGB_ALERT_DIRECTIVES,
imports: [CommonModule],
entryComponents: [NgbAlert]
})
@NgModule({declarations: [NgbAlert], exports: [NgbAlert], imports: [CommonModule], entryComponents: [NgbAlert]})
export class NgbAlertModule {
static forRoot(): ModuleWithProviders { return {ngModule: NgbAlertModule, providers: [NgbAlertConfig]}; }
}
2 changes: 0 additions & 2 deletions src/alert/alert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,3 @@ export class NgbAlert {

closeHandler() { this.close.emit(null); }
}

export const NGB_ALERT_DIRECTIVES = [NgbAlert];
1 change: 1 addition & 0 deletions src/carousel/carousel.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {CommonModule} from '@angular/common';
import {NGB_CAROUSEL_DIRECTIVES} from './carousel';
import {NgbCarouselConfig} from './carousel-config';

export {NgbCarousel, NgbSlide} from './carousel';
export {NgbCarouselConfig} from './carousel-config';

@NgModule({declarations: NGB_CAROUSEL_DIRECTIVES, exports: NGB_CAROUSEL_DIRECTIVES, imports: [CommonModule]})
Expand Down
15 changes: 0 additions & 15 deletions src/carousel/carousel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,38 +134,23 @@ export class NgbCarousel implements AfterContentChecked,
*/
cycle() { this._startTimer(); }

/**
* @internal
*/
cycleToNext() { this.cycleToSelected(this._getNextSlide(this.activeId)); }

/**
* @internal
*/
cycleToPrev() { this.cycleToSelected(this._getPrevSlide(this.activeId)); }

/**
* @internal
*/
cycleToSelected(slideIdx: string) {
let selectedSlide = this._getSlideById(slideIdx);
if (selectedSlide) {
this.activeId = selectedSlide.id;
}
}

/**
* @internal
*/
keyPrev() {
if (this.keyboard) {
this.prev();
}
}

/**
* @internal
*/
keyNext() {
if (this.keyboard) {
this.next();
Expand Down
3 changes: 0 additions & 3 deletions src/datepicker/datepicker-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,6 @@ export class NgbInputDatepicker implements ControlValueAccessor {
}
}

/**
* @internal
*/
manualDateChange(value: string) {
this._model = NgbDate.from(this._parserFormatter.parse(value));
this._onChange(this._model ? {year: this._model.year, month: this._model.month, day: this._model.day} : null);
Expand Down
5 changes: 5 additions & 0 deletions src/datepicker/datepicker.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ import {NgbDatepickerService} from './datepicker-service';
import {NgbDatepickerNavigationSelect} from './datepicker-navigation-select';
import {NgbDatepickerConfig} from './datepicker-config';

export {NgbDatepicker} from './datepicker';
export {NgbDatepickerMonthView} from './datepicker-month-view';
export {NgbDatepickerDayView} from './datepicker-day-view';
export {NgbDatepickerNavigation} from './datepicker-navigation';
export {NgbDatepickerNavigationSelect} from './datepicker-navigation-select';
export {NgbDatepickerConfig} from './datepicker-config';
export {NgbDatepickerI18n} from './datepicker-i18n';
export {NgbDateStruct} from './ngb-date-struct';
Expand Down
9 changes: 0 additions & 9 deletions src/datepicker/datepicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,6 @@ export class NgbDatepicker implements OnChanges,
this.navigateTo(this.startDate);
}

/**
* @internal
*/
onDateSelect(date: NgbDate) {
this._setViewWithinLimits(date);

Expand All @@ -162,17 +159,11 @@ export class NgbDatepicker implements OnChanges,
}
}

/**
* @internal
*/
onNavigateDateSelect(date: NgbDate) {
this._setViewWithinLimits(date);
this._updateData();
}

/**
* @internal
*/
onNavigateEvent(event: NavigationEvent) {
switch (event) {
case NavigationEvent.PREV:
Expand Down
6 changes: 0 additions & 6 deletions src/dropdown/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,12 @@ export class NgbDropdown {
}
}

/**
* @internal
*/
closeFromOutsideClick($event) {
if (this.autoClose && !this._isEventFromToggle($event)) {
this.close();
}
}

/**
* @internal
*/
closeFromOutsideEsc() {
if (this.autoClose) {
this.close();
Expand Down
5 changes: 3 additions & 2 deletions src/pagination/pagination.module.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import {NgModule, ModuleWithProviders} from '@angular/core';
import {CommonModule} from '@angular/common';

import {NGB_PAGINATION_DIRECTIVES} from './pagination';
import {NgbPagination} from './pagination';
import {NgbPaginationConfig} from './pagination-config';

export {NgbPagination} from './pagination';
export {NgbPaginationConfig} from './pagination-config';

@NgModule({declarations: NGB_PAGINATION_DIRECTIVES, exports: NGB_PAGINATION_DIRECTIVES, imports: [CommonModule]})
@NgModule({declarations: [NgbPagination], exports: [NgbPagination], imports: [CommonModule]})
export class NgbPaginationModule {
static forRoot(): ModuleWithProviders { return {ngModule: NgbPaginationModule, providers: [NgbPaginationConfig]}; }
}
2 changes: 0 additions & 2 deletions src/pagination/pagination.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,5 +226,3 @@ export class NgbPagination implements OnChanges {

private _getPageNoInRange(newPageNo): number { return getValueInRange(newPageNo, this._pageCount, 1); }
}

export const NGB_PAGINATION_DIRECTIVES = [NgbPagination];
5 changes: 3 additions & 2 deletions src/popover/popover.module.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import {NgModule, ModuleWithProviders} from '@angular/core';

import {NGB_POPOVER_DIRECTIVES, NgbPopoverWindow} from './popover';
import {NgbPopover, NgbPopoverWindow} from './popover';
import {NgbPopoverConfig} from './popover-config';

export {NgbPopover} from './popover';
export {NgbPopoverConfig} from './popover-config';

@NgModule({declarations: NGB_POPOVER_DIRECTIVES, exports: NGB_POPOVER_DIRECTIVES, entryComponents: [NgbPopoverWindow]})
@NgModule({declarations: [NgbPopover, NgbPopoverWindow], exports: [NgbPopover], entryComponents: [NgbPopoverWindow]})
export class NgbPopoverModule {
static forRoot(): ModuleWithProviders { return {ngModule: NgbPopoverModule, providers: [NgbPopoverConfig]}; }
}
2 changes: 0 additions & 2 deletions src/popover/popover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,5 +140,3 @@ export class NgbPopover implements OnInit, OnDestroy {
this._zoneSubscription.unsubscribe();
}
}

export const NGB_POPOVER_DIRECTIVES = [NgbPopover, NgbPopoverWindow];
5 changes: 3 additions & 2 deletions src/progressbar/progressbar.module.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import {NgModule, ModuleWithProviders} from '@angular/core';
import {NGB_PROGRESSBAR_DIRECTIVES} from './progressbar';
import {NgbProgressbar} from './progressbar';
import {NgbProgressbarConfig} from './progressbar-config';

export {NgbProgressbar} from './progressbar';
export {NgbProgressbarConfig} from './progressbar-config';

@NgModule({declarations: NGB_PROGRESSBAR_DIRECTIVES, exports: NGB_PROGRESSBAR_DIRECTIVES})
@NgModule({declarations: [NgbProgressbar], exports: [NgbProgressbar]})
export class NgbProgressbarModule {
static forRoot(): ModuleWithProviders { return {ngModule: NgbProgressbarModule, providers: [NgbProgressbarConfig]}; }
}
2 changes: 0 additions & 2 deletions src/progressbar/progressbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,3 @@ export class NgbProgressbar {

getPercentValue() { return 100 * this.getValue() / this.max; }
}

export const NGB_PROGRESSBAR_DIRECTIVES = [NgbProgressbar];
5 changes: 3 additions & 2 deletions src/rating/rating.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ import {NgModule, ModuleWithProviders} from '@angular/core';
import {CommonModule} from '@angular/common';
import {NgbRatingConfig} from './rating-config';

import {NGB_RATING_DIRECTIVES} from './rating';
import {NgbRating} from './rating';

export {NgbRating} from './rating';
export {NgbRatingConfig} from './rating-config';

@NgModule({declarations: NGB_RATING_DIRECTIVES, exports: NGB_RATING_DIRECTIVES, imports: [CommonModule]})
@NgModule({declarations: [NgbRating], exports: [NgbRating], imports: [CommonModule]})
export class NgbRatingModule {
static forRoot(): ModuleWithProviders { return {ngModule: NgbRatingModule, providers: [NgbRatingConfig]}; }
}
2 changes: 0 additions & 2 deletions src/rating/rating.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,5 +140,3 @@ export class NgbRating implements OnInit,
return range;
}
}

export const NGB_RATING_DIRECTIVES = [NgbRating];
5 changes: 3 additions & 2 deletions src/timepicker/timepicker.module.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import {NgModule, ModuleWithProviders} from '@angular/core';
import {CommonModule} from '@angular/common';

import {NGB_TIMEPICKER_DIRECTIVES} from './timepicker';
import {NgbTimepicker} from './timepicker';
import {NgbTimepickerConfig} from './timepicker-config';

export {NgbTimepicker} from './timepicker';
export {NgbTimepickerConfig} from './timepicker-config';
export {NgbTimeStruct} from './ngb-time-struct';

@NgModule({declarations: NGB_TIMEPICKER_DIRECTIVES, exports: NGB_TIMEPICKER_DIRECTIVES, imports: [CommonModule]})
@NgModule({declarations: [NgbTimepicker], exports: [NgbTimepicker], imports: [CommonModule]})
export class NgbTimepickerModule {
static forRoot(): ModuleWithProviders { return {ngModule: NgbTimepickerModule, providers: [NgbTimepickerConfig]}; }
}
29 changes: 0 additions & 29 deletions src/timepicker/timepicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,71 +201,44 @@ export class NgbTimepicker implements ControlValueAccessor,

setDisabledState(isDisabled: boolean) { this.disabled = isDisabled; }

/**
* @internal
*/
changeHour(step: number) {
this.model.changeHour(step);
this.propagateModelChange();
}

/**
* @internal
*/
changeMinute(step: number) {
this.model.changeMinute(step);
this.propagateModelChange();
}

/**
* @internal
*/
changeSecond(step: number) {
this.model.changeSecond(step);
this.propagateModelChange();
}

/**
* @internal
*/
updateHour(newVal: string) {
this.model.updateHour(toInteger(newVal));
this.propagateModelChange();
}

/**
* @internal
*/
updateMinute(newVal: string) {
this.model.updateMinute(toInteger(newVal));
this.propagateModelChange();
}

/**
* @internal
*/
updateSecond(newVal: string) {
this.model.updateSecond(toInteger(newVal));
this.propagateModelChange();
}

/**
* @internal
*/
toggleMeridian() {
if (this.meridian) {
this.changeHour(12);
}
}

/**
* @internal
*/
formatHour(value: number) { return padNumber(isNumber(value) ? (value % (this.meridian ? 12 : 24)) : NaN); }

/**
* @internal
*/
formatMinSec(value: number) { return padNumber(value); }


Expand All @@ -287,5 +260,3 @@ export class NgbTimepicker implements ControlValueAccessor,
}
}
}

export const NGB_TIMEPICKER_DIRECTIVES = [NgbTimepicker];
1 change: 1 addition & 0 deletions src/tooltip/tooltip.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {NgbTooltip, NgbTooltipWindow} from './tooltip';
import {NgbTooltipConfig} from './tooltip-config';

export {NgbTooltipConfig} from './tooltip-config';
export {NgbTooltip} from './tooltip';

@NgModule({declarations: [NgbTooltip, NgbTooltipWindow], exports: [NgbTooltip], entryComponents: [NgbTooltipWindow]})
export class NgbTooltipModule {
Expand Down
2 changes: 2 additions & 0 deletions src/typeahead/typeahead.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import {NgbTypeaheadWindow} from './typeahead-window';
import {NgbTypeahead, NgbTypeaheadSelectItemEvent} from './typeahead';
import {NgbTypeaheadConfig} from './typeahead-config';

export {NgbHighlight} from './highlight';
export {NgbTypeaheadWindow} from './typeahead-window';
export {NgbTypeaheadConfig} from './typeahead-config';
export {NgbTypeaheadSelectItemEvent} from './typeahead';

Expand Down
12 changes: 0 additions & 12 deletions src/typeahead/typeahead.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,29 +165,17 @@ export class NgbTypeahead implements ControlValueAccessor,
this._renderer.setElementProperty(this._elementRef.nativeElement, 'disabled', isDisabled);
}

/**
* @internal
*/
dismissPopup() {
if (this.isPopupOpen()) {
this._closePopup();
this._writeInputValue(this._userInput);
}
}

/**
* @internal
*/
isPopupOpen() { return this._windowRef != null; }

/**
* @internal
*/
handleBlur() { this._onTouched(); }

/**
* @internal
*/
handleKeyDown(event: KeyboardEvent) {
if (!this._windowRef) {
return;
Expand Down

0 comments on commit 2101a89

Please sign in to comment.