-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(module:icon): support add icon in feat modules (#4711)
feat(module:icon): support import icon in submodules fix: fix patch feat: rename API docs: fix doc fix: remove redundant code docs: fix unrenamed API chore(module:icon): refactor test: fix tests fix: fix tests BREAKING CHANGE: - `NZ_ICON_DEFAULT_TWOTONE_COLOR` is removed. Use `NzGlobalConfigService` instead. chore: remove strange file test: fix test feat: add forRoot docs: change doc docs: fix icon English doc
- Loading branch information
Wendell
authored
Mar 15, 2020
1 parent
2553328
commit 0bcd2a9
Showing
12 changed files
with
319 additions
and
199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* @license | ||
* Copyright Alibaba.com All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE | ||
*/ | ||
import { PlatformModule } from '@angular/cdk/platform'; | ||
import { ModuleWithProviders, NgModule } from '@angular/core'; | ||
import { IconDefinition } from '@ant-design/icons-angular'; | ||
|
||
import { NzIconDirective } from './icon.directive'; | ||
import { NZ_ICONS, NZ_ICONS_PATCH, NzIconPatchService } from './icon.service'; | ||
|
||
@NgModule({ | ||
exports: [NzIconDirective], | ||
declarations: [NzIconDirective], | ||
imports: [PlatformModule] | ||
}) | ||
export class NzIconModule { | ||
static forRoot(icons: IconDefinition[]): ModuleWithProviders<NzIconModule> { | ||
return { | ||
ngModule: NzIconModule, | ||
providers: [ | ||
{ | ||
provide: NZ_ICONS, | ||
useValue: icons | ||
} | ||
] | ||
}; | ||
} | ||
|
||
static forChild(icons: IconDefinition[]): ModuleWithProviders<NzIconModule> { | ||
return { | ||
ngModule: NzIconModule, | ||
providers: [ | ||
NzIconPatchService, | ||
{ | ||
provide: NZ_ICONS_PATCH, | ||
useValue: icons | ||
} | ||
] | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.