ngx-rocket / generator-ngx-rocket

:rocket: Extensible Angular 14+ enterprise-grade project generator
https://ngx-rocket.github.io/
MIT License
1.53k stars 217 forks source link

Ng-Zorro #443

Closed ltotsas closed 5 years ago

ltotsas commented 5 years ago

Can somebody help me add ng-zorro? i am struggling a bit here :D

6matko commented 5 years ago

It would be easier if you described where are you struggling ? I remember that I had some issues with it as well, but I solved them (Also don't remember how).

6matko commented 5 years ago

Quick update to this question if somebody will be needing in future. I needed to add Ng zorro to my app once again and everything went quite smooth. What did I do:

  1. Used ng add ng-zorro-antd --i18n=en_US from https://ng.ant.design/docs/introduce/en
  2. Since I am using Sass and NgZorro using Less I needed to get those styles to my project as well so I created theme.less in src folder with following content: https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/scripts/site/_site/doc/theme.less
  3. Added src/theme.less to angular.json (styles):
            "styles": [
              "src/theme.less",
              "src/main.scss"
            ],
  4. Added NgZorro providers to app.component.ts:
    providers: [
    { provide: NZ_I18N, useValue: en_US }
    ],
  5. Used NgZorroAntdModule where I need it

Hope it helps and if there any particular errors then those are custom cases that need custom solutions.