Skip to content

Commit

Permalink
Pass default components via forRoot
Browse files Browse the repository at this point in the history
  • Loading branch information
fboeller committed Mar 2, 2021
1 parent afaac6f commit e39ef8a
Show file tree
Hide file tree
Showing 7 changed files with 164 additions and 86 deletions.
179 changes: 111 additions & 68 deletions package-lock.json

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

15 changes: 7 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,20 @@
}
},
"dependencies": {
"@angular/common": "~11.1.0",
"@angular/compiler": "~11.1.0",
"@angular/core": "~11.1.0",
"@angular/common": "~11.2.0",
"@angular/compiler": "~11.2.0",
"@angular/core": "~11.2.0",
"@angular/platform-browser": "^11.2.3",
"@angular/platform-browser-dynamic": "^11.2.3",
"rxjs": "~6.6.0",
"tslib": "^2.0.0",
"zone.js": "~0.10.2"
"zone.js": "~0.11.0"
},
"devDependencies": {
"@angular-builders/jest": "^10.0.1",
"@angular-devkit/build-angular": "~0.1101.1",
"@angular/cli": "~11.1.1",
"@angular/compiler-cli": "~11.1.0",
"@angular/elements": "^11.1.0",
"@angular/cli": "~11.2.0",
"@angular/compiler-cli": "~11.2.0",
"@babel/core": "^7.12.3",
"@types/jest": "^26.0.15",
"@types/node": "^12.11.1",
Expand All @@ -69,7 +68,7 @@
"jest": "^26.6.3",
"jest-marbles": "^2.5.1",
"ng-mocks": "^11.9.0",
"ng-packagr": "^11.1.2",
"ng-packagr": "^11.2.0",
"ngx-build-plus": "^11.0.0",
"prettier": "^2.1.2",
"ts-jest": "^26.4.4",
Expand Down
15 changes: 8 additions & 7 deletions projects/example-app/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';
import {
DEFAULT_LOADING_COMPONENT,
LoadableModule,
} from 'projects/ngx-loadable/src/public-api';
import { LoadableModule } from 'projects/ngx-loadable/src/public-api';
import { SwitchCaseExampleComponent } from './components/switch-case-example/switch-case-example.component';
import { LoadableComponentExampleComponent } from './components/loadable-component-example/loadable-component-example.component';
import { LoadingSpinnerComponent } from './components/loading-spinner/loading-spinner.component';
Expand All @@ -17,9 +14,13 @@ import { LoadingSpinnerComponent } from './components/loading-spinner/loading-sp
LoadableComponentExampleComponent,
LoadingSpinnerComponent,
],
imports: [BrowserModule, LoadableModule],
providers: [
{ provide: DEFAULT_LOADING_COMPONENT, useValue: LoadingSpinnerComponent },
imports: [
BrowserModule,
LoadableModule.forRoot({
defaultComponents: {
loading: LoadingSpinnerComponent,
},
}),
],
bootstrap: [AppComponent],
})
Expand Down
2 changes: 1 addition & 1 deletion projects/example-app/src/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
/***************************************************************************************************
* Zone JS is required by default for Angular itself.
*/
import 'zone.js/dist/zone'; // Included with Angular CLI.
import 'zone.js'; // Included with Angular CLI.

/***************************************************************************************************
* APPLICATION IMPORTS
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { LoadableModule } from './loadable.module';

describe('the loadable module', () => {
it('can be created without options', () => {
expect(LoadableModule.forRoot()).toBeDefined();
});
});
Loading

0 comments on commit e39ef8a

Please sign in to comment.