-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
be3366e
commit 921f1c1
Showing
6 changed files
with
51 additions
and
202 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
107 changes: 0 additions & 107 deletions
107
schematics/ng-add/setup-project/add-animations-module.ts
This file was deleted.
Oops, something went wrong.
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,34 @@ | ||
/** | ||
* 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 { Rule, chain } from '@angular-devkit/schematics'; | ||
import { addRootProvider } from '@schematics/angular/utility'; | ||
|
||
import { Schema } from '../schema'; | ||
|
||
export function addRequiredProviders(options: Schema): Rule { | ||
return chain([ | ||
addAnimations(options), | ||
addHttpClient(options) | ||
]); | ||
} | ||
|
||
function addAnimations(options: Schema): Rule { | ||
return addRootProvider(options.project, ({ code, external }) => { | ||
return code`${external( | ||
'provideAnimationsAsync', | ||
'@angular/platform-browser/animations/async', | ||
)}(${options.animations ? '' : `'noop'`})`; | ||
}); | ||
} | ||
|
||
function addHttpClient(options: Schema): Rule { | ||
return addRootProvider(options.project, ({ code, external }) => { | ||
return code`${external( | ||
'provideHttpClient', | ||
'@angular/common/http', | ||
)}()`; | ||
}); | ||
} |
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