-
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(#305): better injection of NgControl
closes #305
- Loading branch information
Showing
13 changed files
with
382 additions
and
116 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// tslint:disable variable-name | ||
|
||
let NG_ASYNC_VALIDATORS: any | undefined; | ||
let NG_VALIDATORS: any | undefined; | ||
let NG_VALUE_ACCESSOR: any | undefined; | ||
let FormControlDirective: any | undefined; | ||
let NgControl: any | undefined; | ||
try { | ||
// tslint:disable-next-line no-require-imports no-var-requires | ||
const module = require('@angular/forms'); | ||
// istanbul ignore else | ||
if (module) { | ||
NG_ASYNC_VALIDATORS = module.NG_ASYNC_VALIDATORS; | ||
NG_VALIDATORS = module.NG_VALIDATORS; | ||
NG_VALUE_ACCESSOR = module.NG_VALUE_ACCESSOR; | ||
FormControlDirective = module.FormControlDirective; | ||
NgControl = module.NgControl; | ||
} | ||
} catch (e) { | ||
// nothing to do; | ||
} | ||
|
||
export default { | ||
FormControlDirective, | ||
NG_ASYNC_VALIDATORS, | ||
NG_VALIDATORS, | ||
NG_VALUE_ACCESSOR, | ||
NgControl, | ||
}; |
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
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
Oops, something went wrong.