Skip to content

Commit

Permalink
Fix module for [email protected] with forRoot config, update version
Browse files Browse the repository at this point in the history
  • Loading branch information
spirosikmd committed Oct 19, 2016
1 parent 19a48a6 commit 080c86a
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 18 deletions.
4 changes: 0 additions & 4 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,5 @@ Thumbs.db
# IDE generated files
.idea

# Ignored files
*.ts
!*.d.ts

# Demo
docs
4 changes: 2 additions & 2 deletions docs/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {AppComponent} from './app.component';
import {Focus} from '../index';
import {FocusModule} from '../index';
@NgModule({
imports: [BrowserModule, Focus],
imports: [BrowserModule, FocusModule.forRoot()],
declarations: [AppComponent],
bootstrap: [AppComponent]
})
Expand Down
21 changes: 13 additions & 8 deletions docs/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var AppModule = (function () {
}
AppModule = __decorate([
core_1.NgModule({
imports: [platform_browser_1.BrowserModule, index_1.Focus],
imports: [platform_browser_1.BrowserModule, index_1.FocusModule.forRoot()],
declarations: [app_component_1.AppComponent],
bootstrap: [app_component_1.AppComponent]
}),
Expand All @@ -68,7 +68,7 @@ platform.bootstrapModule(app_module_1.AppModule);
},{"./app.module":2,"@angular/core":7,"@angular/platform-browser-dynamic":8,"core-js/es7/reflect":10,"zone.js/dist/zone":109}],4:[function(require,module,exports){
"use strict";
var focus_module_1 = require('./src/focus.module');
exports.Focus = focus_module_1.Focus;
exports.FocusModule = focus_module_1.FocusModule;

},{"./src/focus.module":111}],5:[function(require,module,exports){
(function (global){
Expand Down Expand Up @@ -37624,18 +37624,23 @@ var __metadata = (this && this.__metadata) || function (k, v) {
};
var core_1 = require('@angular/core');
var focus_directive_1 = require('./focus.directive');
var Focus = (function () {
function Focus() {
var FocusModule = (function () {
function FocusModule() {
}
Focus = __decorate([
FocusModule.forRoot = function () {
return {
ngModule: FocusModule
};
};
FocusModule = __decorate([
core_1.NgModule({
declarations: [focus_directive_1.FocusDirective],
exports: [focus_directive_1.FocusDirective]
}),
__metadata('design:paramtypes', [])
], Focus);
return Focus;
], FocusModule);
return FocusModule;
}());
exports.Focus = Focus;
exports.FocusModule = FocusModule;

},{"./focus.directive":110,"@angular/core":7}]},{},[3]);
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export {Focus} from './src/focus.module';
export {FocusModule} from './src/focus.module';
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular2-focus",
"version": "1.0.1",
"version": "1.0.2",
"description": "Angular2 directive that gives focus on an element depending on a given expression",
"main": "index.js",
"module": "index.js",
Expand Down
9 changes: 7 additions & 2 deletions src/focus.module.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import {NgModule} from '@angular/core';
import {NgModule, ModuleWithProviders} from '@angular/core';
import {FocusDirective} from './focus.directive';

@NgModule({
declarations: [FocusDirective],
exports: [FocusDirective]
})
export class Focus {
export class FocusModule {
static forRoot (): ModuleWithProviders {
return {
ngModule: FocusModule
};
}
}

0 comments on commit 080c86a

Please sign in to comment.