Guest User

Untitled

a guest
Nov 18th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. // Singleton Module
  2. @NgModule()
  3. @Injectable()
  4. export class ComponentHelper {
  5. constructor() {}
  6.  
  7. static forRoot(): ModuleWithProviders {
  8. return {
  9. ngModule: ComponentHelper
  10. }
  11. }
  12.  
  13. public static DowngradeFactory(componentName: string, className: any): void {
  14. angular.module(APP_MODULE_NAME).factory(componentName, downgradeInjectable(className));
  15. }
  16.  
  17. public static DowngradeDirective(componentName: string, className: any): void {
  18. angular.module(APP_MODULE_NAME).directive(componentName, downgradeComponent({
  19. component: className
  20. }))
  21. }
  22. }
Add Comment
Please, Sign In to add comment