Skip to content

Commit 6f32177

Browse files
committed
cleaned up code
1 parent 84c2f7f commit 6f32177

12 files changed

+20
-78
lines changed

.npmignore

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1 @@
1-
# Node generated files
2-
node_modules
3-
npm-debug.log
4-
5-
# OS generated files
6-
Thumbs.db
7-
.DS_Store
8-
**/.DS_Store
9-
Desktop.ini
10-
11-
# Ignored files
12-
*.ts
13-
!*.d.ts
14-
tsconfig.json
15-
tsconfig.publish.json
16-
styles.css
17-
systemjs.config.js
18-
index.html
19-
compiled
20-
.npmignore
21-
22-
# JetBrains
23-
.idea
24-
.project
25-
.settings
26-
.idea/*
27-
*.iml
28-
29-
# Other
30-
nbproject
31-
manifest.mf
32-
build.xml
33-
34-
/aot
35-
36-
*.metadata.json
37-
*.ngsummary.json
38-
*.ngfactory.js
1+
# the only included files/directories are specified in the package.json "files" field

app/about/about.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Component } from '@angular/core';
22
import { Router } from '@angular/router';
3-
import { FlashMessagesService } from '../../module/index';
3+
import { FlashMessagesService } from '../../module/flash-messages.service';
44

55
@Component({
66
template: `

app/app.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { AppComponent } from './app.component';
77
import { HomeComponent } from './home/home.component';
88
import { AboutComponent } from './about/about.component';
99

10-
import { FlashMessagesModule } from '../module/index';
10+
import { FlashMessagesModule } from '../module/module';
1111

1212
@NgModule({
1313
imports: [

app/home/home.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Component } from '@angular/core';
22
import { Router } from '@angular/router';
3-
import { FlashMessagesService } from '../../module/index';
3+
import { FlashMessagesService } from '../../module/flash-messages.service';
44

55
@Component({
66
template: `

index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

module/flash-message.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ export class FlashMessage implements FlashMessageInterface {
1010
showCloseBtn: boolean = false;
1111
timer: number;
1212

13-
constructor(text?: string, cssClass?: string, closeOnClick?:boolean, showCloseBtn?:boolean) {
14-
this.text = text;
15-
this.cssClass = cssClass;
16-
this.closeOnClick = closeOnClick;
17-
this.showCloseBtn = showCloseBtn;
13+
constructor(text?: string, cssClass?: string, closeOnClick?: boolean, showCloseBtn?: boolean) {
14+
if (text) this.text = text;
15+
if (cssClass) this.cssClass = cssClass;
16+
if (closeOnClick) this.closeOnClick = closeOnClick;
17+
if (showCloseBtn) this.showCloseBtn = showCloseBtn;
1818
}
1919
}

module/flash-messages.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ export class FlashMessagesComponent implements OnInit {
4141
timeout: 2500,
4242
closeOnClick: false,
4343
showCloseBtn: false,
44-
cssClass: ''
44+
cssClass: '',
45+
text: "default message"
4546
};
4647

4748
for (var attrname in options) { (<any>defaults)[attrname] = (<any>options)[attrname]; }

module/index.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular2-flash-messages",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "Angular 2 flash messages module",
55
"files": [
66
"module/*.d.ts",

systemjs.config.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
2626
// other libraries
2727
'rxjs': 'npm:rxjs',
28-
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api',
2928
},
3029
// packages tells the System loader how to load when no filename and/or no extension
3130
packages: {
@@ -39,10 +38,6 @@
3938
},
4039
rxjs: {
4140
defaultExtension: 'js'
42-
},
43-
'angular-in-memory-web-api': {
44-
main: './index.js',
45-
defaultExtension: 'js'
4641
}
4742
}
4843
});

0 commit comments

Comments
 (0)