Skip to content

Commit b8ca6f3

Browse files
committed
docs(README): fix example in README.md
1 parent 5b0090a commit b8ca6f3

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

README.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff 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
2525
import { 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
})
3236
export 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

0 commit comments

Comments
 (0)