index.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. "use strict";
  2. /**
  3. * @license
  4. * Copyright Google LLC All Rights Reserved.
  5. *
  6. * Use of this source code is governed by an MIT-style license that can be
  7. * found in the LICENSE file at https://angular.io/license
  8. */
  9. Object.defineProperty(exports, "__esModule", { value: true });
  10. const schematics_1 = require("@angular-devkit/schematics");
  11. const schematics_2 = require("@angular/cdk/schematics");
  12. /**
  13. * Scaffolds a new navigation component.
  14. * Internally it bootstraps the base component schematic
  15. */
  16. function default_1(options) {
  17. return schematics_1.chain([
  18. schematics_2.buildComponent(Object.assign({}, options), {
  19. template: './__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template',
  20. stylesheet: './__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template',
  21. }),
  22. options.skipImport ? schematics_1.noop() : addNavModulesToModule(options)
  23. ]);
  24. }
  25. exports.default = default_1;
  26. /**
  27. * Adds the required modules to the relative module.
  28. */
  29. function addNavModulesToModule(options) {
  30. return (host) => {
  31. const modulePath = schematics_2.findModuleFromOptions(host, options);
  32. schematics_2.addModuleImportToModule(host, modulePath, 'LayoutModule', '@angular/cdk/layout');
  33. schematics_2.addModuleImportToModule(host, modulePath, 'MatToolbarModule', '@angular/material/toolbar');
  34. schematics_2.addModuleImportToModule(host, modulePath, 'MatButtonModule', '@angular/material/button');
  35. schematics_2.addModuleImportToModule(host, modulePath, 'MatSidenavModule', '@angular/material/sidenav');
  36. schematics_2.addModuleImportToModule(host, modulePath, 'MatIconModule', '@angular/material/icon');
  37. schematics_2.addModuleImportToModule(host, modulePath, 'MatListModule', '@angular/material/list');
  38. return host;
  39. };
  40. }
  41. //# sourceMappingURL=index.js.map