index.js 1.3 KB

12345678910111213141516171819202122232425262728293031
  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 utils_1 = require("../../utils");
  12. /** Scaffolds a new Angular component that uses the Drag and Drop module. */
  13. function default_1(options) {
  14. return schematics_1.chain([
  15. utils_1.buildComponent(Object.assign({}, options), {
  16. template: './__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template',
  17. stylesheet: './__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template',
  18. }),
  19. options.skipImport ? schematics_1.noop() : addDragDropModulesToModule(options)
  20. ]);
  21. }
  22. exports.default = default_1;
  23. /** Adds the required modules to the main module of the CLI project. */
  24. function addDragDropModulesToModule(options) {
  25. return (host) => {
  26. const modulePath = utils_1.findModuleFromOptions(host, options);
  27. utils_1.addModuleImportToModule(host, modulePath, 'DragDropModule', '@angular/cdk/drag-drop');
  28. return host;
  29. };
  30. }
  31. //# sourceMappingURL=index.js.map