Skip to content

Commit c43cc03

Browse files
committed
initial ngx-bootstrap support (closes udos86#463)
1 parent 0f5282a commit c43cc03

File tree

5 files changed

+20
-5
lines changed

5 files changed

+20
-5
lines changed

karma-test-shim.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ System.config({
8787
"@telerik/kendo-intl": "npm:@telerik/kendo-intl/dist/npm/main.js",
8888
"angular2-text-mask": "npm:angular2-text-mask/dist/angular2TextMask.js",
8989
"ionic-angular": "npm:ionic-angular/bundles/ionic.umd.js",
90+
"ngx-bootstrap/datepicker": "npm:ngx-bootstrap/bundles/ngx-bootstrap.umd.js",
91+
"ngx-bootstrap/timepicker": "npm:ngx-bootstrap/bundles/ngx-bootstrap.umd.js",
9092
"primeng": "npm:primeng",
9193
"rxjs": "npm:rxjs",
9294
"text-mask-core": "npm:text-mask-core",

karma.conf.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ module.exports = function (config) {
6969

7070
{pattern: "node_modules/ionic-angular/**/*.js", included: false, watched: false},
7171

72+
{pattern: "node_modules/ngx-bootstrap/**/*.js", included: false, watched: false},
73+
7274
{pattern: "node_modules/primeng/**/*.js", included: false, watched: false},
7375
{pattern: "node_modules/primeng/**/*.js.map", included: false, watched: false},
7476

packages/ui-bootstrap/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"angular",
1010
"angular 2",
1111
"bootstrap",
12+
"ngx-bootstrap",
1213
"dynamic forms",
1314
"forms",
1415
"ng dynamic forms",
@@ -34,8 +35,9 @@
3435
"@angular/forms": "^5.0.0",
3536
"@angular/common": "^5.0.0",
3637
"@ng-dynamic-forms/core": "^5.2.0",
37-
"bootstrap": "^3.3.7",
3838
"angular2-text-mask": "^8.0.1",
39+
"bootstrap": "^3.3.7",
40+
"ngx-bootstrap": "^2.0.0-rc.0",
3941
"rxjs": "^5.5.2"
4042
}
4143
}

packages/ui-bootstrap/src/dynamic-bootstrap-form-control.component.spec.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { TestBed, async, inject, ComponentFixture } from "@angular/core/testing"
22
import { DebugElement, SimpleChange } from "@angular/core";
33
import { ReactiveFormsModule, FormGroup, FormControl } from "@angular/forms";
44
import { By } from "@angular/platform-browser";
5+
import { BsDatepickerModule } from "ngx-bootstrap/datepicker";
6+
import { TimepickerModule } from "ngx-bootstrap/timepicker";
57
import { TextMaskModule } from "angular2-text-mask";
68
import {
79
DynamicFormsCoreModule,
@@ -56,7 +58,13 @@ describe("DynamicFormBootstrapComponent test suite", () => {
5658

5759
TestBed.configureTestingModule({
5860

59-
imports: [ReactiveFormsModule, DynamicFormsCoreModule.forRoot(), TextMaskModule],
61+
imports: [
62+
ReactiveFormsModule,
63+
DynamicFormsCoreModule.forRoot(),
64+
TextMaskModule,
65+
BsDatepickerModule.forRoot(),
66+
TimepickerModule.forRoot()
67+
],
6068
declarations: [DynamicBootstrapFormControlComponent]
6169

6270
}).compileComponents().then(() => {
@@ -181,7 +189,7 @@ describe("DynamicFormBootstrapComponent test suite", () => {
181189

182190
expect(testFn(formModel[1])).toEqual(BootstrapFormControlType.Group);
183191

184-
expect(testFn(formModel[2])).toBeNull();
192+
expect(testFn(formModel[2])).toEqual(BootstrapFormControlType.DatePicker);
185193

186194
expect(testFn(formModel[3])).toBeNull();
187195

@@ -203,6 +211,6 @@ describe("DynamicFormBootstrapComponent test suite", () => {
203211

204212
expect(testFn(formModel[12])).toEqual(BootstrapFormControlType.TextArea);
205213

206-
expect(testFn(formModel[13])).toBeNull();
214+
expect(testFn(formModel[13])).toEqual(BootstrapFormControlType.TimePicker);
207215
});
208216
});

sample/systemjs.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@
7272
"angular2-text-mask": "npm:angular2-text-mask/dist/angular2TextMask.js",
7373
"app": "./",
7474
"ionic-angular": "npm:ionic-angular/bundles/ionic.umd.js",
75-
"ngx-bootstrap": "npm:ngx-bootstrap/bundles/ngx-bootstrap.umd.js",
75+
"ngx-bootstrap/datepicker": "npm:ngx-bootstrap/bundles/ngx-bootstrap.umd.js",
76+
"ngx-bootstrap/timepicker": "npm:ngx-bootstrap/bundles/ngx-bootstrap.umd.js",
7677
"primeng": "npm:primeng",
7778
"rxjs": "npm:rxjs",
7879
"text-mask-addons": "npm:text-mask-addons",

0 commit comments

Comments
 (0)