Skip to content

Commit 5fb34a6

Browse files
committed
fix(abdtp-component): aot build was failing because _model is private
remove private modifier from _model, added aot build to npm test, and optimized class imports fixes #425
1 parent 936968f commit 5fb34a6

17 files changed

+778
-291
lines changed

package-lock.json

+731-235
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+17-23
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"lint": "ng lint",
2222
"ng": "ng",
2323
"start": "ng serve",
24-
"test": "ng lint && ng test --single-run --code-coverage && npm run build:lib ",
24+
"test": "ng lint && ng test --single-run --code-coverage && ng build --prod && npm run build:lib ",
2525
"test:tdd": "ng test",
2626
"semantic-release": "semantic-release",
2727
"travis-deploy-once": "travis-deploy-once"
@@ -52,18 +52,18 @@
5252
"zone.js": ">=0.8.18"
5353
},
5454
"devDependencies": {
55-
"@angular/animations": "^5.2.4",
56-
"@angular/cli": "^1.6.8",
57-
"@angular/common": "^5.2.4",
58-
"@angular/compiler": "^5.2.4",
59-
"@angular/compiler-cli": "^5.2.4",
60-
"@angular/core": "^5.2.4",
61-
"@angular/forms": "^5.2.4",
62-
"@angular/http": "^5.2.4",
63-
"@angular/language-service": "^5.2.4",
64-
"@angular/platform-browser": "^5.2.4",
65-
"@angular/platform-browser-dynamic": "^5.2.4",
66-
"@angular/router": "^5.2.4",
55+
"@angular/animations": "^5.2.7",
56+
"@angular/cli": "^1.7.2",
57+
"@angular/common": "^5.2.7",
58+
"@angular/compiler": "^5.2.7",
59+
"@angular/compiler-cli": "^5.2.7",
60+
"@angular/core": "^5.2.7",
61+
"@angular/forms": "^5.2.7",
62+
"@angular/http": "^5.2.7",
63+
"@angular/language-service": "^5.2.7",
64+
"@angular/platform-browser": "^5.2.7",
65+
"@angular/platform-browser-dynamic": "^5.2.7",
66+
"@angular/router": "^5.2.7",
6767
"@compodoc/compodoc": "^1.0.8",
6868
"@types/jasmine": "~2.8.6",
6969
"@types/jasminewd2": "~2.0.3",
@@ -77,16 +77,16 @@
7777
"karma": "^2.0.0",
7878
"karma-chrome-launcher": "^2.2.0",
7979
"karma-cli": "^1.0.1",
80-
"karma-coverage-istanbul-reporter": "^1.4.1",
80+
"karma-coverage-istanbul-reporter": "^1.4.2",
8181
"karma-jasmine": "^1.1.1",
8282
"karma-jasmine-html-reporter": "^0.2.2",
83-
"moment": "^2.20.1",
84-
"ng-packagr": "^2.1.0",
83+
"moment": "^2.21.0",
84+
"ng-packagr": "^2.2.0",
8585
"open-iconic": "^1.1.1",
8686
"protractor": "^5.3.0",
8787
"rxjs": "^5.5.6",
8888
"scss-bundle": "^2.1.2",
89-
"semantic-release": "^12.4.1",
89+
"semantic-release": "^15.0.0",
9090
"stylelint": "^9.1.1",
9191
"ts-node": "^5.0.1",
9292
"tslint": "^5.9.1",
@@ -110,12 +110,6 @@
110110
"dist"
111111
]
112112
}
113-
],
114-
"success": [
115-
"@semantic-release/github"
116-
],
117-
"fail": [
118-
"@semantic-release/github"
119113
]
120114
},
121115
"dependencies": {

src/app/app.component.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@
77
* found in the LICENSE file at https://github.com/dalelotts/angular-bootstrap-datetimepicker/blob/master/LICENSE
88
*/
99

10-
import {Component, ViewChild} from '@angular/core';
11-
import {DlDateTimePickerComponent} from '../lib/dl-date-time-picker';
10+
import {Component} from '@angular/core';
1211
import {DateButton} from '../lib/dl-date-time-picker';
13-
import moment = require('moment');
12+
import * as moment from 'moment';
1413
import {unitOfTime} from 'moment';
1514

1615
@Component({

src/lib/dl-date-time-picker/dl-date-time-picker.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ export class DlDateTimePickerComponent<D> implements OnChanges, OnInit, ControlV
221221
*
222222
* @internal
223223
**/
224-
private _model: DlDateTimePickerModel;
224+
_model: DlDateTimePickerModel;
225225

226226
/**
227227
* Maps view name to the next view (the view for the next smallest increment of time).

src/lib/dl-date-time-picker/dl-model-provider-day.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import {DlModelProvider} from './dl-model-provider';
1111
import {DlDateTimePickerModel} from './dl-date-time-picker-model';
12-
import {Component, SimpleChanges} from '@angular/core';
12+
import {SimpleChanges} from '@angular/core';
1313
import * as _moment from 'moment';
1414

1515
/**

src/lib/dl-date-time-picker/dl-model-provider-hour.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99

1010
import {DlModelProvider} from './dl-model-provider';
1111
import {DlDateTimePickerModel} from './dl-date-time-picker-model';
12-
import {Component, SimpleChanges} from '@angular/core';
12+
import {SimpleChanges} from '@angular/core';
1313
import * as _moment from 'moment';
14+
1415
/**
1516
* Work around for moment namespace conflict when used with webpack and rollup.
1617
* See https://github.com/dherges/ng-packagr/issues/163

src/lib/dl-date-time-picker/dl-model-provider-minute.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99

1010
import {DlModelProvider} from './dl-model-provider';
1111
import {DlDateTimePickerModel} from './dl-date-time-picker-model';
12-
import {Component, SimpleChanges} from '@angular/core';
12+
import {SimpleChanges} from '@angular/core';
1313
import * as _moment from 'moment';
14+
1415
/**
1516
* Work around for moment namespace conflict when used with webpack and rollup.
1617
* See https://github.com/dherges/ng-packagr/issues/163

src/lib/dl-date-time-picker/dl-model-provider-month.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99

1010
import {DlModelProvider} from './dl-model-provider';
1111
import {DlDateTimePickerModel} from './dl-date-time-picker-model';
12-
import {Component, SimpleChanges} from '@angular/core';
12+
import {SimpleChanges} from '@angular/core';
1313
import * as _moment from 'moment';
14+
1415
/**
1516
* Work around for moment namespace conflict when used with webpack and rollup.
1617
* See https://github.com/dherges/ng-packagr/issues/163

src/lib/dl-date-time-picker/dl-model-provider-year.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99

1010
import {DlModelProvider} from './dl-model-provider';
1111
import {DlDateTimePickerModel} from './dl-date-time-picker-model';
12-
import {Component, SimpleChanges} from '@angular/core';
12+
import {SimpleChanges} from '@angular/core';
1313
import * as _moment from 'moment';
1414
import {Moment} from 'moment';
15+
1516
/**
1617
* Work around for moment namespace conflict when used with webpack and rollup.
1718
* See https://github.com/dherges/ng-packagr/issues/163

src/lib/dl-date-time-picker/specs/start-view/day-view.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ describe('DlDateTimePickerComponent startView=day', () => {
150150
// I think it is related to https://github.com/angular/angular/issues/10816
151151
const activeElement = debugElement.query(By.css('.dl-abdtp-active')).nativeElement;
152152
activeElement.focus();
153-
dispatchKeyboardEvent(activeElement, 'keydown', RIGHT_ARROW);
153+
dispatchKeyboardEvent(activeElement, 'keydown', HOME);
154154
fixture.detectChanges();
155155

156156
const selectedElements = fixture.debugElement.queryAll(By.css('.dl-abdtp-selected'));

src/lib/dl-date-time-picker/specs/start-view/hour-view.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ describe('DlDateTimePickerComponent startView=hour', () => {
132132
expect(tabIndexElements.length).toBe(1);
133133
});
134134

135-
it('should contain 1 .dl-abdtp-selectedelement for the current value', () => {
135+
it('should contain 1 .dl-abdtp-selected element for the current value', () => {
136136
component.picker.value = moment().startOf('hour').valueOf();
137137
fixture.detectChanges();
138138

@@ -141,7 +141,7 @@ describe('DlDateTimePickerComponent startView=hour', () => {
141141
// I think it is related to https://github.com/angular/angular/issues/10816
142142
const activeElement = debugElement.query(By.css('.dl-abdtp-active')).nativeElement;
143143
activeElement.focus();
144-
dispatchKeyboardEvent(activeElement, 'keydown', RIGHT_ARROW);
144+
dispatchKeyboardEvent(activeElement, 'keydown', HOME);
145145
fixture.detectChanges();
146146

147147
const currentElements = fixture.debugElement.queryAll(By.css('.dl-abdtp-selected'));

src/lib/dl-date-time-picker/specs/start-view/minute-view.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ describe('DlDateTimePickerComponent startView=minute', () => {
151151
expect(currentElements[0].nativeElement.classList).toContain(currentMoment.valueOf().toString());
152152
});
153153

154-
it('should contain 1 .dl-abdtp-selectedelement for the current minute', () => {
154+
it('should contain 1 .dl-abdtp-selected element for the current minute', () => {
155155
const currentElements = fixture.debugElement.queryAll(By.css('.dl-abdtp-active'));
156156
expect(currentElements.length).toBe(1);
157157

src/lib/dl-date-time-picker/specs/start-view/month-view.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ describe('DlDateTimePickerComponent startView=month', () => {
130130
expect(currentElements[0].nativeElement.classList).toContain(moment().startOf('month').valueOf().toString());
131131
});
132132

133-
it('should contain 1 .dl-abdtp-selectedelement for the current month', () => {
133+
it('should contain 1 .dl-abdtp-selected element for the current month', () => {
134134
component.picker.value = moment().startOf('month').valueOf();
135135
fixture.detectChanges();
136136

@@ -139,7 +139,7 @@ describe('DlDateTimePickerComponent startView=month', () => {
139139
// I think it is related to https://github.com/angular/angular/issues/10816
140140
const activeElement = debugElement.query(By.css('.dl-abdtp-active')).nativeElement;
141141
activeElement.focus();
142-
dispatchKeyboardEvent(activeElement, 'keydown', RIGHT_ARROW);
142+
dispatchKeyboardEvent(activeElement, 'keydown', HOME);
143143
fixture.detectChanges();
144144

145145
const selectedElements = fixture.debugElement.queryAll(By.css('.dl-abdtp-selected'));

src/lib/dl-date-time-picker/specs/start-view/year-view.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ describe('DlDateTimePickerComponent', () => {
137137
expect(activeElements[0].nativeElement.classList).toContain(moment().startOf('year').valueOf().toString());
138138
});
139139

140-
it('should contain 1 .dl-abdtp-selectedelement for the current year', () => {
140+
it('should contain 1 .dl-abdtp-selected element for the current year', () => {
141141
component.picker.value = moment().startOf('year').valueOf();
142142
fixture.detectChanges();
143143

@@ -146,7 +146,7 @@ describe('DlDateTimePickerComponent', () => {
146146
// I think it is related to https://github.com/angular/angular/issues/10816
147147
const activeElement = debugElement.query(By.css('.dl-abdtp-active')).nativeElement;
148148
activeElement.focus();
149-
dispatchKeyboardEvent(activeElement, 'keydown', RIGHT_ARROW);
149+
dispatchKeyboardEvent(activeElement, 'keydown', HOME);
150150
fixture.detectChanges();
151151

152152
const selectedElements = fixture.debugElement.queryAll(By.css('.dl-abdtp-selected'));

src/main.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
* found in the LICENSE file at https://github.com/dalelotts/angular-bootstrap-datetimepicker/blob/master/LICENSE
88
*/
99

10-
import { enableProdMode } from '@angular/core';
11-
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
10+
import {enableProdMode} from '@angular/core';
11+
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
1212

13-
import { AppModule } from './app/app.module';
14-
import { environment } from './environments/environment';
13+
import {AppModule} from './app/app.module';
14+
import {environment} from './environments/environment';
1515

1616
if (environment.production) {
1717
enableProdMode();

src/polyfills.ts

+4-7
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@
4444
/** Evergreen browsers require these. **/
4545
// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
4646
import 'core-js/es7/reflect';
47+
/***************************************************************************************************
48+
* Zone JS is required by Angular itself.
49+
*/
50+
import 'zone.js/dist/zone'; // Included with Angular CLI.
4751

4852

4953
/**
@@ -54,13 +58,6 @@ import 'core-js/es7/reflect';
5458

5559

5660

57-
/***************************************************************************************************
58-
* Zone JS is required by Angular itself.
59-
*/
60-
import 'zone.js/dist/zone'; // Included with Angular CLI.
61-
62-
63-
6461
/***************************************************************************************************
6562
* APPLICATION IMPORTS
6663
*/

src/test.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,8 @@ import 'zone.js/dist/sync-test';
1515
import 'zone.js/dist/jasmine-patch';
1616
import 'zone.js/dist/async-test';
1717
import 'zone.js/dist/fake-async-test';
18-
import { getTestBed } from '@angular/core/testing';
19-
import {
20-
BrowserDynamicTestingModule,
21-
platformBrowserDynamicTesting
22-
} from '@angular/platform-browser-dynamic/testing';
18+
import {getTestBed} from '@angular/core/testing';
19+
import {BrowserDynamicTestingModule, platformBrowserDynamicTesting} from '@angular/platform-browser-dynamic/testing';
2320

2421
// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
2522
declare const __karma__: any;

0 commit comments

Comments
 (0)