diff --git a/package.json b/package.json index ef46d6e..d9e1e38 100644 --- a/package.json +++ b/package.json @@ -37,14 +37,14 @@ } }, "dependencies": { - "@angular/common": "^4.0.0", - "@angular/compiler": "^4.0.0", - "@angular/core": "^4.0.0", - "@angular/forms": "^4.0.0", - "@angular/http": "^4.0.0", - "@angular/platform-browser": "^4.0.0", - "@angular/platform-browser-dynamic": "^4.0.0", - "@angular/router": "^4.0.0", + "@angular/common": "^4.0.2", + "@angular/compiler": "^4.0.2", + "@angular/core": "^4.0.2", + "@angular/forms": "^4.0.2", + "@angular/http": "^4.0.2", + "@angular/platform-browser": "^4.0.2", + "@angular/platform-browser-dynamic": "^4.0.2", + "@angular/router": "^4.0.2", "core-js": "^2.4.1", "hammerjs": "^2.0.8", "jquery": "^2.2.4", diff --git a/sample/lib-dist b/sample/lib-dist new file mode 120000 index 0000000..85d8c32 --- /dev/null +++ b/sample/lib-dist @@ -0,0 +1 @@ +../dist \ No newline at end of file diff --git a/sample/package.json b/sample/package.json index be70111..13c10b3 100644 --- a/sample/package.json +++ b/sample/package.json @@ -11,14 +11,14 @@ }, "private": true, "dependencies": { - "@angular/common": "^4.0.0", - "@angular/compiler": "^4.0.0", - "@angular/core": "^4.0.0", - "@angular/forms": "^4.0.0", - "@angular/http": "^4.0.0", - "@angular/platform-browser": "^4.0.0", - "@angular/platform-browser-dynamic": "^4.0.0", - "@angular/router": "^4.0.0", + "@angular/common": "^4.0.2", + "@angular/compiler": "^4.0.2", + "@angular/core": "^4.0.2", + "@angular/forms": "^4.0.2", + "@angular/http": "^4.0.2", + "@angular/platform-browser": "^4.0.2", + "@angular/platform-browser-dynamic": "^4.0.2", + "@angular/router": "^4.0.2", "core-js": "^2.4.1", "hammerjs": "^2.0.8", "jquery": "^2.2.4", @@ -37,12 +37,12 @@ "karma": "~1.4.1", "karma-chrome-launcher": "~2.0.0", "karma-cli": "~1.0.1", + "karma-coverage-istanbul-reporter": "^0.2.0", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "^0.2.2", - "karma-coverage-istanbul-reporter": "^0.2.0", "protractor": "~5.1.0", "ts-node": "~2.0.0", "tslint": "~4.5.0", - "typescript": "~2.2.0" + "typescript": "^2.2.2" } } diff --git a/sample/src/app/app.component.ts b/sample/src/app/app.component.ts index 33b9f72..a6cdc6d 100644 --- a/sample/src/app/app.component.ts +++ b/sample/src/app/app.component.ts @@ -1,8 +1,6 @@ import {Component} from "@angular/core"; import {Location} from '@angular/common'; -import "angular2-materialize"; - @Component({ selector: "app-root", styles: [`header, main, footer { padding-left: 260px; }`], diff --git a/sample/src/main.ts b/sample/src/main.ts index a9ca1ca..9e62760 100644 --- a/sample/src/main.ts +++ b/sample/src/main.ts @@ -4,8 +4,14 @@ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { AppModule } from './app/app.module'; import { environment } from './environments/environment'; +import { MaterializeModule } from "angular2-materialize"; +import { MaterializeDirective } from "angular2-materialize"; + if (environment.production) { enableProdMode(); } +console.log("MaterializeModule",MaterializeModule); +console.log("MaterializeDirective",MaterializeDirective); + platformBrowserDynamic().bootstrapModule(AppModule); diff --git a/src/materialize-module.ts b/src/materialize-module.ts index 10134c4..bfae5ba 100644 --- a/src/materialize-module.ts +++ b/src/materialize-module.ts @@ -1,4 +1,4 @@ -import { NgModule } from '@angular/core'; +import { NgModule, ModuleWithProviders } from '@angular/core'; import { CommonModule } from '@angular/common'; import { MaterializeDirective } from "./materialize-directive"; @@ -14,5 +14,9 @@ import { MaterializeDirective } from "./materialize-directive"; ] }) export class MaterializeModule { - + static forRoot(): ModuleWithProviders { + return { + ngModule: MaterializeModule + }; + } } \ No newline at end of file diff --git a/src/tsconfig.json b/src/tsconfig.json index 3f9be42..d92f962 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -22,9 +22,7 @@ "angularCompilerOptions": { "annotateForClosureCompiler": true, "strictMetadataEmit": true, - "skipTemplateCodegen": true, - "flatModuleOutFile": "angular2-materialize.js", - "flatModuleId": "angular2-materialize" + "skipTemplateCodegen": true }, "files": [ "./index.ts"