From f948d6ea5c5242878cae9f8bfba0641fe1c8abc6 Mon Sep 17 00:00:00 2001 From: Douglas Ludlow Date: Thu, 8 Sep 2016 22:34:14 -0600 Subject: [PATCH] Update everything to rc6, fix demo/tests. --- .travis.yml | 2 +- demo/app.component.ts | 16 +- demo/app.module.ts | 25 ++ demo/app.routes.ts | 13 +- demo/hello.component.ts | 2 - demo/main.ts | 6 +- demo/modal-demo.component.html | 4 +- demo/modal-demo.component.ts | 5 +- demo/tsconfig.json | 12 + index.html | 35 +- karma.conf.js | 42 ++- package.json | 17 +- src/ng2-bs3-modal/components/modal-body.ts | 1 - src/ng2-bs3-modal/components/modal-footer.ts | 4 +- src/ng2-bs3-modal/components/modal-header.ts | 4 +- src/ng2-bs3-modal/components/modal.ts | 4 +- src/ng2-bs3-modal/directives/autofocus.ts | 6 +- src/ng2-bs3-modal/ng2-bs3-modal.ts | 33 +- test/jasmine.d.ts | 6 + test/ng2-bs3-modal.spec.ts | 320 +++++++++---------- test/test-main.js | 29 +- test/tsconfig.json | 3 +- tsconfig.json | 2 - typings.json | 10 +- 24 files changed, 328 insertions(+), 273 deletions(-) create mode 100644 demo/app.module.ts create mode 100644 demo/tsconfig.json create mode 100644 test/jasmine.d.ts diff --git a/.travis.yml b/.travis.yml index 58d5f42..0570e95 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: node_js node_js: - "5" - - "4" + - "6" script: - npm run build diff --git a/demo/app.component.ts b/demo/app.component.ts index ef441e4..b8a5dd6 100644 --- a/demo/app.component.ts +++ b/demo/app.component.ts @@ -1,20 +1,8 @@ -import { Component, OnInit } from '@angular/core'; -import { ROUTER_DIRECTIVES, Router } from '@angular/router'; - -import { appRouterProviders } from './app.routes'; +import { Component } from '@angular/core'; @Component({ selector: 'modal-demo', template: '', - providers: [appRouterProviders], - directives: [ROUTER_DIRECTIVES] }) -export class AppComponent implements OnInit { - - constructor(private router: Router) { - } - - ngOnInit() { - this.router.navigate(['/']); - } +export class AppComponent{ } diff --git a/demo/app.module.ts b/demo/app.module.ts new file mode 100644 index 0000000..c8f6d71 --- /dev/null +++ b/demo/app.module.ts @@ -0,0 +1,25 @@ +import { NgModule } from '@angular/core'; +import { BrowserModule } from '@angular/platform-browser'; +import { FormsModule } from '@angular/forms'; +import { Ng2Bs3ModalModule } from '../src/ng2-bs3-modal/ng2-bs3-modal'; +import { routing } from './app.routes'; +import { AppComponent } from './app.component'; +import { ModalDemoComponent } from './modal-demo.component'; +import { HelloComponent } from './hello.component'; + +@NgModule({ + imports: [ + BrowserModule, + FormsModule, + routing, + Ng2Bs3ModalModule + ], + declarations: [ + AppComponent, + ModalDemoComponent, + HelloComponent + ], + bootstrap: [AppComponent] +}) +export class AppModule { +} \ No newline at end of file diff --git a/demo/app.routes.ts b/demo/app.routes.ts index 9ea0c90..b734113 100644 --- a/demo/app.routes.ts +++ b/demo/app.routes.ts @@ -1,13 +1,12 @@ -import { provideRouter, RouterConfig } from '@angular/router'; +import { ModuleWithProviders } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; import { ModalDemoComponent } from './modal-demo.component'; import { HelloComponent } from './hello.component'; -const routes: RouterConfig = [ - {path: '', component: ModalDemoComponent}, - {path: 'hello', component: HelloComponent} +const routes: Routes = [ + { path: '', component: ModalDemoComponent }, + { path: 'hello', component: HelloComponent } ]; -export const appRouterProviders = [ - provideRouter(routes) -]; \ No newline at end of file +export const routing: ModuleWithProviders = RouterModule.forRoot(routes); \ No newline at end of file diff --git a/demo/hello.component.ts b/demo/hello.component.ts index 5002c94..361619d 100644 --- a/demo/hello.component.ts +++ b/demo/hello.component.ts @@ -1,9 +1,7 @@ import { Component } from '@angular/core'; -import { ROUTER_DIRECTIVES } from '@angular/router'; @Component({ selector: 'hello-component', - directives: [ROUTER_DIRECTIVES], template: `

Hello

diff --git a/demo/main.ts b/demo/main.ts index 17dfedf..2470c95 100644 --- a/demo/main.ts +++ b/demo/main.ts @@ -1,4 +1,4 @@ -import { bootstrap } from '@angular/platform-browser-dynamic'; -import { AppComponent } from './app.component'; +import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; +import { AppModule } from './app.module'; -bootstrap(AppComponent, []); +platformBrowserDynamic().bootstrapModule(AppModule); diff --git a/demo/modal-demo.component.html b/demo/modal-demo.component.html index e12a2b1..c3f00de 100644 --- a/demo/modal-demo.component.html +++ b/demo/modal-demo.component.html @@ -87,11 +87,11 @@
- +
- +
diff --git a/demo/modal-demo.component.ts b/demo/modal-demo.component.ts index 87b9e64..c99be01 100644 --- a/demo/modal-demo.component.ts +++ b/demo/modal-demo.component.ts @@ -1,16 +1,15 @@ import {Component, ViewChild, ViewEncapsulation} from '@angular/core'; import { Router } from '@angular/router'; -import { MODAL_DIRECTIVES, ModalComponent } from '../src/ng2-bs3-modal/ng2-bs3-modal'; +import { ModalComponent } from '../src/ng2-bs3-modal/ng2-bs3-modal'; @Component({ selector: 'modal-demo-component', templateUrl: 'demo/modal-demo.component.html', - directives: [MODAL_DIRECTIVES], styles: [ `.ng-valid[required] { border-left: 5px solid #5cb85c; /* green */ }`, - `.ng-invalid { + `.ng-invalid:not(.ng-untouched):not(form) { border-left: 5px solid #d9534f; /* red */ }`, `.red-text { diff --git a/demo/tsconfig.json b/demo/tsconfig.json new file mode 100644 index 0000000..78efa05 --- /dev/null +++ b/demo/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "module": "commonjs", + "moduleResolution": "node", + "target": "es5", + "noImplicitAny": false, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "inlineSourceMap": true, + "declaration": false + } +} diff --git a/index.html b/index.html index fec86c8..512c47a 100644 --- a/index.html +++ b/index.html @@ -4,22 +4,22 @@ Angular2 Bootstrap3 Modal Component - + - + - - + +