File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -14,24 +14,37 @@ This is a simple library for [Angular][angular], implemented in the [Angular Pac
1414
1515### via NPM
1616
17- ` npm i @thisissoon/angular-masonry --save `
17+ ` npm i @thisissoon/angular-masonry masonry-layout --save `
1818
1919### via Yarn
2020
21- ` yarn add @thisissoon/angular-masonry `
21+ ` yarn add @thisissoon/angular-masonry masonry-layout `
2222
2323` app.module.ts `
2424``` ts
2525import { MasonryModule } from ' @thisissoon/angular-masonry' ;
2626
27+ const masonryProviders = [
28+ { provide: Masonry , useFactory : () => window [' Masonry' ] }
29+ ];
30+
2731@NgModule ({
2832 imports: [
29- MasonryModule .forRoot (window [ ' Masonry ' ] )
33+ MasonryModule .forRoot (masonryProviders )
3034 ]
3135})
3236export class AppModule { }
3337```
3438
39+ ` .angular-cli.json `
40+
41+ Add the Masonry library javascript to your angular cli config
42+ ``` ts
43+ " scripts" : [
44+ " ../node_modules/masonry-layout/dist/masonry.pkgd.js"
45+ ],
46+ ```
47+
3548#### Universal app (only needed if using platform-server)
3649` app.server.module.ts `
3750``` ts
You can’t perform that action at this time.
0 commit comments