Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configuration 'modules' added to BusyConfig #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ Thumbs.db

# Style scripts
build/busy.js

#Webstorm IDE settings
/.idea
4 changes: 4 additions & 0 deletions build/src/busy-config.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/// <reference types="core-js" />
import { Subscription } from 'rxjs/Subscription';
export declare class BusyConfig implements IBusyConfig {
template: string;
modules: any[];
delay: number;
minDuration: number;
backdrop: boolean;
Expand All @@ -10,6 +12,7 @@ export declare class BusyConfig implements IBusyConfig {
}
export interface IBusyConfig {
template?: string;
modules?: any[];
delay?: number;
minDuration?: number;
backdrop?: boolean;
Expand All @@ -19,6 +22,7 @@ export interface IBusyConfig {
}
export declare const BUSY_CONFIG_DEFAULTS: {
template: string;
modules: any[];
delay: number;
minDuration: number;
backdrop: boolean;
Expand Down
1 change: 1 addition & 0 deletions build/src/busy-config.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/src/busy-config.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions build/src/busy.component.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export declare class BusyComponent {
wrapperClass: string;
template: string;
context: IBusyContext;
modules: any[];
constructor(tracker: PromiseTrackerService);
isActive(): boolean;
}
2 changes: 1 addition & 1 deletion build/src/busy.component.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/src/busy.component.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/src/busy.directive.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export declare class BusyDirective implements DoCheck {
private backdropRef;
constructor(service: BusyService, tracker: PromiseTrackerService, cfResolver: ComponentFactoryResolver, vcRef: ViewContainerRef, injector: Injector);
private normalizeOptions(options);
dectectOptionsChange(): boolean;
private dectectOptionsChange();
ngDoCheck(): void;
ngOnDestroy(): void;
private destroyComponents();
Expand Down
1 change: 1 addition & 0 deletions build/src/busy.directive.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/src/busy.directive.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions build/src/promise-tracker.service.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="core-js" />
import { Subscription } from 'rxjs/Subscription';
export declare class PromiseTrackerService {
promiseList: Array<Promise<any> | Subscription>;
Expand Down
29 changes: 29 additions & 0 deletions demo/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
"declaration": true,
"outDir": "../build/demo",
"removeComments": true,
"typeRoots": [
"../node_modules/@types"
]
},
"exclude": [
],
"filesGlob": [
"./**/*.ts"
],
"awesomeTypescriptLoaderOptions": {
"resolveGlobs": true,
"forkChecker": true
},
"compileOnSave": false,
"buildOnSave": false,
"atom": {
"rewriteTsconfig": false
}
}
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@
"watch:busy": "npm run watch",
"build:demo": "cross-env NODE_ENV=demo webpack --progress",
"watch:demo": "cross-env NODE_ENV=demo webpack-dev-server --inline --progress --profile --colors --watch --display-error-details --display-cached --content-base demo/asset",
"test": "cross-env NODE_ENV=test webpack --inline --progress --colors --watch --content-base test"
"test": "cross-env NODE_ENV=test webpack --inline --progress --colors --watch --content-base test",
"tsc": "node_modules/.bin/tsc",
"pretsc.src": "node_modules/.bin/rimraf build/src/**/*.d.ts",
"tsc.src": "npm run tsc -- -p src/",
"tsc.demo": "npm run tsc -- -p demo/"
},
"dependencies": {
"ts-metadata-helper": "~0.0.4",
Expand All @@ -44,6 +48,8 @@
"@angular/platform-browser": "~2.4.0",
"@angular/platform-browser-dynamic": "~2.4.0",
"@angular/router": "~3.4.0",
"@types/core-js": "^0.9.35",
"@types/node": "^7.0.5",
"autoprefixer": "^6.3.7",
"awesome-typescript-loader": "^0.19.1",
"bootstrap": "4.0.0-alpha.2",
Expand Down
3 changes: 3 additions & 0 deletions src/busy-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {Subscription} from 'rxjs/Subscription';

export class BusyConfig implements IBusyConfig {
template: string;
modules: any[];
delay: number;
minDuration: number;
backdrop: boolean;
Expand All @@ -22,6 +23,7 @@ export class BusyConfig implements IBusyConfig {

export interface IBusyConfig {
template?: string;
modules?: any[];
delay?: number;
minDuration?: number;
backdrop?: boolean;
Expand Down Expand Up @@ -52,6 +54,7 @@ export const BUSY_CONFIG_DEFAULTS = {
</div>
</div>
`,
modules: [],
delay: 0,
minDuration: 0,
backdrop: true,
Expand Down
3 changes: 2 additions & 1 deletion src/busy.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export interface IBusyContext {
selector: 'ng-busy',
template: `
<div [class]="wrapperClass" *ngIf="isActive()" @flyInOut>
<DynamicComponent [componentTemplate]="template" [componentContext]="context">
<DynamicComponent [componentTemplate]="template" [componentContext]="context" [componentModules]="modules">
</DynamicComponent>
</div>
`,
Expand All @@ -52,6 +52,7 @@ export class BusyComponent {
context: IBusyContext = {
message: null
};
modules: any[];

constructor(private tracker: PromiseTrackerService) {
}
Expand Down
1 change: 1 addition & 0 deletions src/busy.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,6 @@ export class BusyDirective implements DoCheck {
instance.context.message = message;
instance.wrapperClass = wrapperClass;
instance.template = template;
instance.modules = this.optionsNorm.modules;
}
}
29 changes: 29 additions & 0 deletions src/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
"declaration": true,
"outDir": "../build/src",
"removeComments": true,
"typeRoots": [
"../node_modules/@types"
]
},
"exclude": [
],
"filesGlob": [
"./**/*.ts"
],
"awesomeTypescriptLoaderOptions": {
"resolveGlobs": true,
"forkChecker": true
},
"compileOnSave": false,
"buildOnSave": false,
"atom": {
"rewriteTsconfig": false
}
}